From 0b535eb8e7f2a3116d0eeb37dd4060e0f18a49f5 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 18 Dec 2024 18:44:48 +0100 Subject: [PATCH] Make sure the Docker image has the git version in it --- .dockerignore | 1 - Dockerfile | 3 +-- docker-bake.hcl | 6 ++++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index bd8f0b041..bd1816b8b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,7 +6,6 @@ frontend/dist tools/syn2mas/** docs/ .devcontainer/ -.git/ .github/ .gitignore Dockerfile diff --git a/Dockerfile b/Dockerfile index 7824f9fad..618a8d732 100644 --- a/Dockerfile +++ b/Dockerfile @@ -140,8 +140,7 @@ RUN --network=default \ --package mas-cli # Build the rest -COPY ./Cargo.toml ./Cargo.lock /app/ -COPY ./crates /app/crates +COPY ./ /app ENV SQLX_OFFLINE=true # Network access: cargo auditable needs it RUN --network=default \ diff --git a/docker-bake.hcl b/docker-bake.hcl index fd6741db1..1c3e94d9c 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -9,6 +9,12 @@ target "docker-metadata-action-syn2mas" {} // This sets the platforms and is further extended by GitHub Actions to set the // output and the cache locations target "base" { + args = { + // This is set so that when we use a git context, the .git directory is + // present, as we infer the version at build time out of it + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } + platforms = [ "linux/amd64", "linux/arm64",