Skip to content

Commit

Permalink
omit using cache for docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Traf333 committed Jan 24, 2024
1 parent d80ef20 commit a0bd795
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/create-release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ jobs:
build-args: |
WORKER_MODE_ARG=sidechain
ADDITIONAL_FEATURES_ARG=
IMAGE_FOR_RELEASE=true
- name: Build worker
uses: docker/build-push-action@v5
Expand Down
19 changes: 14 additions & 5 deletions tee-worker/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,26 @@ ENV WORKER_MODE=$WORKER_MODE_ARG
ARG ADDITIONAL_FEATURES_ARG
ENV ADDITIONAL_FEATURES=$ADDITIONAL_FEATURES_ARG

ARG IMAGE_FOR_RELEASE=false
ENV IMAGE_FOR_RELEASE=$IMAGE_FOR_RELEASE

ARG FINGERPRINT=none

WORKDIR $HOME/tee-worker
COPY . $HOME

RUN \
rm -rf /opt/rust/registry/cache && mv /home/ubuntu/worker-cache/registry/cache /opt/rust/registry && \
rm -rf /opt/rust/registry/index && mv /home/ubuntu/worker-cache/registry/index /opt/rust/registry && \
rm -rf /opt/rust/git/db && mv /home/ubuntu/worker-cache/git/db /opt/rust/git && \
rm -rf /opt/rust/sccache && mv /home/ubuntu/worker-cache/sccache /opt/rust && \
make && sccache --show-stats
if [ "$IMAGE_FOR_RELEASE" = "true" ]; then \
echo "Omit chache for release image"; \
make;
else \
rm -rf /opt/rust/registry/cache && mv /home/ubuntu/worker-cache/registry/cache /opt/rust/registry && \
rm -rf /opt/rust/registry/index && mv /home/ubuntu/worker-cache/registry/index /opt/rust/registry && \
rm -rf /opt/rust/git/db && mv /home/ubuntu/worker-cache/git/db /opt/rust/git && \
rm -rf /opt/rust/sccache && mv /home/ubuntu/worker-cache/sccache /opt/rust && \
make && sccache --show-stats;
fi


RUN cargo test --release

Expand Down

0 comments on commit a0bd795

Please sign in to comment.