Skip to content

Commit 0c46cf3

Browse files
committed
#731 docker multiplatform WIP
1 parent 18810b6 commit 0c46cf3

File tree

2 files changed

+18
-29
lines changed

2 files changed

+18
-29
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -88,31 +88,3 @@ jobs:
8888
env:
8989
# (required)
9090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91-
92-
push_to_registry:
93-
name: Push Docker image to Docker Hub
94-
runs-on: ubuntu-latest
95-
steps:
96-
- name: Check out the repo
97-
uses: actions/checkout@v2
98-
99-
- name: Log in to Docker Hub
100-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
101-
with:
102-
username: joepmeneer
103-
password: ${{ secrets.DOCKERHUB_TOKEN }}
104-
105-
- name: Extract metadata (tags, labels) for Docker
106-
id: meta
107-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
108-
with:
109-
images: joepmeneer/atomic-server
110-
github-token: ${{ secrets.GITHUB_TOKEN }}
111-
112-
- name: Build and push Docker image
113-
uses: docker/build-push-action@v2
114-
with:
115-
context: .
116-
push: true
117-
tags: ${{ steps.meta.outputs.tags }},joepmeneer/atomic-server:latest
118-
labels: ${{ steps.meta.outputs.labels }}

Earthfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ build-all:
2323
# Errors
2424
# BUILD +cross-build --TARGET=aarch64-apple-darwin
2525

26+
docker-all:
27+
BUILD --platform=linux/amd64 +docker-musl --TARGET=x86_64-unknown-linux-musl
28+
BUILD --platform=linux/arm/v7 +docker-musl --TARGET=armv7-unknown-linux-musleabihf
29+
2630
install:
2731
RUN apt-get update -qq
2832
RUN rustup component add clippy
@@ -62,6 +66,19 @@ lint:
6266
FROM +source
6367
DO rust+CARGO --args="clippy --no-deps --all-features --all-targets"
6468

69+
docker-musl:
70+
ARG tag="latest,sha-\$EARTHLY_GIT_SHORT_HASH"
71+
ARG --required TARGET
72+
COPY --chmod=0755 (+build/atomic-server --TARGET=${TARGET}) /atomic-server-bin
73+
RUN /atomic-server-bin --version
74+
# For a complete list of possible ENV vars or available flags, run with `--help`
75+
ENV ATOMIC_DATA_DIR="/atomic-storage/data"
76+
ENV ATOMIC_CONFIG_DIR="/atomic-storage/config"
77+
ENV ATOMIC_PORT="80"
78+
EXPOSE 80
79+
VOLUME /atomic-storage
80+
ENTRYPOINT ["/atomic-server-bin"]
81+
6582
docker:
6683
FROM jeanblanchard/alpine-glibc:3.17.5
6784
ARG tags="joepmeneer/atomic-server:develop"
@@ -77,7 +94,7 @@ docker:
7794
VOLUME /atomic-storage
7895
ENTRYPOINT ["/atomic-server-bin"]
7996
# Push to github container registry
80-
# SAVE IMAGE --push ghcr.io/atomicdata-dev/atomic-server:${tag}
97+
SAVE IMAGE --push ghcr.io/atomicdata-dev/atomic-server:${tag}
8198
# Push to dockerhub
8299
SAVE IMAGE --push ${tags}
83100

0 commit comments

Comments
 (0)