From b659ec36025e4fa81ad95452f376606a87be3118 Mon Sep 17 00:00:00 2001 From: 0xaatif Date: Thu, 4 Jul 2024 10:40:19 +0100 Subject: [PATCH] refactor: one image --- .github/workflows/docker_build.yml | 10 +++++----- .github/workflows/docker_build_push.yml | 14 +------------- Dockerfile | 21 ++------------------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 41bdbbbf7..c907bbf39 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -19,8 +19,8 @@ jobs: uses: actions/checkout@v4 - run: | - docker build --progress=plain --build-arg=PROFILE=dev --build-arg=ENTRYPOINT=leader --tag scratch . - docker run --rm scratch --help - - docker build --progress=plain --build-arg=PROFILE=dev --build-arg=ENTRYPOINT=worker --tag scratch . - docker run --rm scratch --help + docker build --progress=plain --build-arg=PROFILE=dev --tag scratch . + docker run --rm --init --entrypoint leader scratch --help + docker run --rm --init --entrypoint worker scratch --help + docker run --rm --init --entrypoint rpc scratch --help + docker run --rm --init --entrypoint verifier scratch --help diff --git a/.github/workflows/docker_build_push.yml b/.github/workflows/docker_build_push.yml index 1727bd682..ff37de6be 100644 --- a/.github/workflows/docker_build_push.yml +++ b/.github/workflows/docker_build_push.yml @@ -46,10 +46,9 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - - name: Push to GitHub Container Registry - Leader + - name: Push to GitHub Container Registry uses: docker/build-push-action@v3 with: - build-args: ["ENTRYPOINT=leader"] push: true # platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta_leader.outputs.tags }} @@ -68,14 +67,3 @@ jobs: type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - - - name: Push to GitHub Container Registry - Worker - uses: docker/build-push-action@v3 - with: - build-args: ["ENTRYPOINT=worker"] - push: true - # platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta_worker.outputs.tags }} - labels: ${{ steps.meta_worker.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index c05e80c53..a95629433 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # This is loosely based on `docker init`'s rust template. # For a completely clean build, run something like this: # ``` -# docker build --build-arg=PROFILE=dev --build-arg=ENTRYPOINT=leader --no-cache +# docker build --build-arg=PROFILE=dev --no-cache # ``` ############# @@ -80,26 +80,9 @@ FROM debian:bullseye-slim AS final RUN apt-get update && apt-get install -y \ ca-certificates \ libjemalloc2 \ - libssl-dev \ - tini \ && rm -rf /var/lib/apt/lists/* -COPY --from=build /output/* /usr/local/bin/ -RUN <