CI: Remove .dockerignore to ensure reproducible builds

Since go 1.18, built binaries also include VCS information such as the
built commit. This information is also included in the official
binaries. To ensure that the Docker container recreates the same
binaries, the .git folder must also be transferred into the container.
Thus, remove the .dockerignore file.

The copied files must also be owned by the current user within the
container, as git refuses to work otherwise.
This commit is contained in:
Michael Eischer 2023-06-17 16:22:50 +02:00
parent 6b82cce1bd
commit 3a93e28605
2 changed files with 1 additions and 12 deletions

View File

@ -1,11 +0,0 @@
# Folders
.git/
.github/
changelog/
doc/
docker/
# Files
.gitignore
.golangci.yml
*.md

View File

@ -5,7 +5,7 @@ FROM --platform=linux/amd64 restic/builder:latest as helper
ARG TARGETOS
ARG TARGETARCH
COPY . /restic
COPY --chown=build . /restic
RUN go run helpers/build-release-binaries/main.go --platform $TARGETOS/$TARGETARCH --skip-compress
RUN mv /output/restic_${TARGETOS}_${TARGETARCH} /output/restic