Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 130f5c0

Browse files
author
Athos Couto
committed
Try to optimize pr-images workflow by caching Dockerfile.dev
1 parent fcb039a commit 130f5c0

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

.github/workflows/pr-images.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
with:
2323
submodules: recursive
2424

25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
2528
- name: Log in to the Container registry
2629
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
2730
with:
@@ -36,9 +39,11 @@ jobs:
3639
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3740

3841
- name: Build and push Docker image
39-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
42+
uses: docker/build-push-action@v5
4043
with:
41-
context: .
4244
push: true
45+
file: Dockerfile.dev
4346
tags: ${{ steps.meta.outputs.tags }}-${{ github.event.pull_request.head.sha }}
4447
labels: ${{ steps.meta.outputs.labels }}
48+
cache-from: type=registry,ref=user/app:buildcache
49+
cache-to: type=registry,ref=user/app:buildcache,mode=max

Dockerfile.dev

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ FROM rust:slim-bullseye as builder
33
RUN apt update
44

55
RUN apt install -y libclang-dev clang \
6-
build-essential tcl protobuf-compiler file \
7-
libssl-dev pkg-config
6+
build-essential tcl protobuf-compiler file \
7+
libssl-dev pkg-config
88

99
RUN apt clean
1010
RUN update-ca-certificates
@@ -20,20 +20,21 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
2020

2121
# runtime
2222
FROM debian:bullseye-slim
23-
RUN apt update
24-
25-
COPY --from=builder /sqld/bin /bin/sqld
26-
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
27-
COPY docker-entrypoint.sh /usr/local/bin
2823

24+
EXPOSE 5001 8080
2925
VOLUME [ "/var/lib/sqld" ]
3026

27+
RUN apt update
28+
3129
RUN groupadd --system --gid 666 sqld
3230
RUN adduser --system --home /var/lib/sqld --uid 666 --gid 666 sqld
3331
USER sqld
3432
WORKDIR /var/lib/sqld
3533

36-
EXPOSE 5001 8080
34+
COPY docker-entrypoint.sh /usr/local/bin
35+
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
36+
37+
COPY --from=builder /sqld/bin /bin/sqld
3738

3839
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
3940
CMD ["/bin/sqld"]

0 commit comments

Comments
 (0)