Skip to content

Commit

Permalink
Fix docker cacheing (#217)
Browse files Browse the repository at this point in the history
* add test workflow for docker cache

* set docker image to github output

* use docker cache correctly

* update deprecated statements

* remove test workflow
  • Loading branch information
codingpaula authored Oct 24, 2024
1 parent 07d984d commit b45e0ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ jobs:
echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
Expand All @@ -101,13 +99,6 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build
uses: docker/build-push-action@v6
with:
Expand All @@ -116,15 +107,8 @@ jobs:
build-args: INSTALL_DEV=true
push: true
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max

# Uploading the README.md is not a core feature of docker/build-push-action yet
- name: Update README
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ COPY LICENSE README.md rosys.code-workspace ./
ADD ./rosys /rosys/rosys
RUN poetry install -vvv

ENV PYTHONPATH "/rosys"
ENV PYTHONPATH="/rosys"

EXPOSE 8080

WORKDIR /app/
COPY ./start.sh /
COPY ./main.py /app/

CMD /start.sh
CMD ["/start.sh"]

0 comments on commit b45e0ed

Please sign in to comment.