Skip to content

Commit eaf86ce

Browse files
authored
build: pin swag CLI and oauth2-proxy, ignore build artifacts in docker context (apache#8989)
Make the backend container build inputs reproducible and shrink the Docker build context: - Align the swag CLI pin to v1.16.6 across backend/Makefile, backend/Dockerfile and backend/Dockerfile.local so local, CI and image builds generate Swagger docs with the same tool version. - Pin the oauth2-proxy dev auth proxy image to v7.15.3-amd64 in both docker-compose-dev-mysql.yml and docker-compose-dev-postgresql.yml. - Add backend/.dockerignore to keep regenerated build artifacts (bin/, mocks/, logs/, Python venv/build output, coverage files and OS junk) out of the build context. Source under python/ is retained. No functional/runtime code changes. Signed-off-by: DoDiODev <DoDiDev@proton.me>
1 parent 1cbd835 commit eaf86ce

6 files changed

Lines changed: 29 additions & 5 deletions

File tree

backend/.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Build artifacts: regenerated inside the image (GOBIN=/app/bin + make build-plugin/build-server).
2+
# Shipping the host's pre-built bin/ (multiple GB of plugin .so files) bloats the
3+
# build context and the builder layer, which can exhaust the Docker VM and crash BuildKit.
4+
bin/
5+
6+
# Generated mocks (regenerated via make mock inside the image)
7+
mocks/
8+
9+
# Runtime logs
10+
logs/
11+
12+
# Python build/venv artifacts (regenerated; Dockerfile.server reinstalls from
13+
# requirements.txt / pyproject and runs python/build.sh). Source under python/ is kept.
14+
**/.venv/
15+
**/__pycache__/
16+
**/*.pyc
17+
python/.devlake-python-build-root/
18+
19+
# Test / coverage output
20+
*.out
21+
coverage.txt
22+
23+
# OS / editor junk
24+
.DS_Store

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN if [ "$(arch)" != "x86_64" ] ; then \
5050
fi
5151

5252
RUN go install github.com/vektra/mockery/v2@v2.53.6
53-
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.1
53+
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.6
5454

5555
COPY --from=debian-amd64 /usr/include /rootfs-amd64/usr/include
5656
COPY --from=debian-amd64 /usr/lib/x86_64-linux-gnu /rootfs-amd64/usr/lib/x86_64-linux-gnu

backend/Dockerfile.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ RUN mkdir -p /tmp/build && cd /tmp/build && \
4848
ldconfig
4949

5050
RUN go install github.com/vektra/mockery/v2@v2.53.6
51-
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.1
51+
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.6
5252

5353
WORKDIR /app
5454
COPY . /app

backend/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ all: build
2828

2929
go-dep:
3030
go install github.com/vektra/mockery/v2@v2.53.6
31-
go install github.com/swaggo/swag/cmd/swag@v1.16.1
31+
go install github.com/swaggo/swag/cmd/swag@v1.16.6
3232
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2
3333

3434
go-dev-tools:

docker-compose-dev-mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ services:
9797
- devlake
9898

9999
authproxy:
100-
image: quay.io/oauth2-proxy/oauth2-proxy:v7.4.0-amd64
100+
image: quay.io/oauth2-proxy/oauth2-proxy:v7.15.3-amd64
101101
network_mode: "host"
102102
ports:
103103
- 4181:4180

docker-compose-dev-postgresql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ services:
9393
- devlake
9494

9595
authproxy:
96-
image: quay.io/oauth2-proxy/oauth2-proxy:v7.4.0-amd64
96+
image: quay.io/oauth2-proxy/oauth2-proxy:v7.15.3-amd64
9797
network_mode: "host"
9898
ports:
9999
- 4180:4180

0 commit comments

Comments
 (0)