Skip to content

Commit

Permalink
#731 docker multiplatform WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Dec 7, 2023
1 parent 18810b6 commit b544070
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 29 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,3 @@ jobs:
env:
# (required)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: joepmeneer
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: joepmeneer/atomic-server
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }},joepmeneer/atomic-server:latest
labels: ${{ steps.meta.outputs.labels }}
19 changes: 18 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ build-all:
# Errors
# BUILD +cross-build --TARGET=aarch64-apple-darwin

docker-all:
BUILD --platform=linux/amd64 +docker-musl --TARGET=x86_64-unknown-linux-musl
BUILD --platform=linux/arm/v7 +docker-musl --TARGET=armv7-unknown-linux-musleabihf

install:
RUN apt-get update -qq
RUN rustup component add clippy
Expand Down Expand Up @@ -62,6 +66,19 @@ lint:
FROM +source
DO rust+CARGO --args="clippy --no-deps --all-features --all-targets"

docker-musl:
ARG tag="latest,sha-\$EARTHLY_GIT_SHORT_HASH"
ARG --required TARGET
COPY --chmod=0755 (+build/atomic-server --TARGET=${TARGET}) /atomic-server-bin
RUN /atomic-server-bin --version
# For a complete list of possible ENV vars or available flags, run with `--help`
ENV ATOMIC_DATA_DIR="/atomic-storage/data"
ENV ATOMIC_CONFIG_DIR="/atomic-storage/config"
ENV ATOMIC_PORT="80"
EXPOSE 80
VOLUME /atomic-storage
ENTRYPOINT ["/atomic-server-bin"]

docker:
FROM jeanblanchard/alpine-glibc:3.17.5
ARG tags="joepmeneer/atomic-server:develop"
Expand All @@ -77,7 +94,7 @@ docker:
VOLUME /atomic-storage
ENTRYPOINT ["/atomic-server-bin"]
# Push to github container registry
# SAVE IMAGE --push ghcr.io/atomicdata-dev/atomic-server:${tag}
SAVE IMAGE --push ghcr.io/atomicdata-dev/atomic-server:${tag}
# Push to dockerhub
SAVE IMAGE --push ${tags}

Expand Down

0 comments on commit b544070

Please sign in to comment.