From a84b15ab159c3e958e45486f22518f82955e6b95 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Wed, 13 Mar 2024 17:37:47 +0400 Subject: [PATCH 1/2] Move Docker build files --- .github/dependabot.yml | 2 +- Taskfile.yml | 22 +++++++++---------- build/{docker => }/buildkitd.toml | 0 .../all-in-one.Dockerfile | 0 .../all-in-one/entrypoint.sh | 0 .../all-in-one/ferretdb.sh | 0 .../all-in-one/postgresql.sh | 0 .../development.Dockerfile | 0 build/{docker => ferretdb}/group | 0 build/{docker => ferretdb}/passwd | 0 .../production.Dockerfile | 0 11 files changed, 12 insertions(+), 12 deletions(-) rename build/{docker => }/buildkitd.toml (100%) rename build/{docker => ferretdb}/all-in-one.Dockerfile (100%) rename build/{docker => ferretdb}/all-in-one/entrypoint.sh (100%) rename build/{docker => ferretdb}/all-in-one/ferretdb.sh (100%) rename build/{docker => ferretdb}/all-in-one/postgresql.sh (100%) rename build/{docker => ferretdb}/development.Dockerfile (100%) rename build/{docker => ferretdb}/group (100%) rename build/{docker => ferretdb}/passwd (100%) rename build/{docker => ferretdb}/production.Dockerfile (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 71d18b6cb5cf..e7b3ad537143 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -18,7 +18,7 @@ updates: time: "01:42" - package-ecosystem: "docker" - directory: "/build/docker" + directory: "/build/ferretdb" labels: ["deps", "not ready"] assignees: [AlekSi] open-pull-requests-limit: 20 diff --git a/Taskfile.yml b/Taskfile.yml index c50d557f3306..dc8e8862ced6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -562,7 +562,7 @@ tasks: --name=ferretdb --bootstrap=true --use=false - --config=./build/docker/buildkitd.toml + --config=./build/buildkitd.toml --driver=docker-container --driver-opt network=host --driver-opt env.JAEGER_TRACE=127.0.0.1:6831 @@ -586,7 +586,7 @@ tasks: cmds: - > docker buildx build --builder=ferretdb - --file=build/docker/{{.FILE}}.Dockerfile + --file=build/{{.FILE}}.Dockerfile --build-arg=LABEL_VERSION={{.VERSION}} --build-arg=LABEL_COMMIT={{.COMMIT}} --target={{.TARGET}} @@ -619,7 +619,7 @@ tasks: - bin/envtool{{exeExt}} shell mkdir tmp/bin-dev - task: docker-build vars: - FILE: development + FILE: ferretdb/development TARGET: development-binary PLATFORM: linux/amd64,linux/arm64,linux/arm/v7 # TODO https://github.com/FerretDB/FerretDB/issues/3354 OUTPUT: type=local,dest=tmp/build @@ -639,7 +639,7 @@ tasks: - bin/envtool{{exeExt}} shell mkdir tmp/bin - task: docker-build vars: - FILE: production + FILE: ferretdb/production TARGET: production-binary PLATFORM: linux/amd64,linux/arm64,linux/arm/v7 # TODO https://github.com/FerretDB/FerretDB/issues/3354 OUTPUT: type=local,dest=tmp/build @@ -669,7 +669,7 @@ tasks: - echo 'docker-all-in-one' > build/version/package.txt - task: docker-build vars: - FILE: all-in-one + FILE: ferretdb/all-in-one TARGET: all-in-one PLATFORM: linux/amd64,linux/arm64 # no mongosh for arm/v6 and arm/v7 OUTPUT: type=image,push=true @@ -682,7 +682,7 @@ tasks: - echo 'docker-development' > build/version/package.txt - task: docker-build vars: - FILE: development + FILE: ferretdb/development TARGET: development PLATFORM: linux/amd64,linux/arm64,linux/arm/v7 # TODO https://github.com/FerretDB/FerretDB/issues/3354 OUTPUT: type=image,push=true @@ -695,7 +695,7 @@ tasks: - echo 'docker' > build/version/package.txt - task: docker-build vars: - FILE: production + FILE: ferretdb/production TARGET: production PLATFORM: linux/amd64,linux/arm64,linux/arm/v7 # TODO https://github.com/FerretDB/FerretDB/issues/3354 OUTPUT: type=image,push=true @@ -744,7 +744,7 @@ tasks: - bin/envtool{{exeExt}} shell mkdir tmp/debs - task: docker-build vars: - FILE: development + FILE: ferretdb/development TARGET: development-binary PLATFORM: linux/amd64,linux/arm64,linux/arm/v7 # TODO https://github.com/FerretDB/FerretDB/issues/3354 OUTPUT: type=local,dest=tmp/build @@ -772,7 +772,7 @@ tasks: - bin/envtool{{exeExt}} shell mkdir tmp/debs - task: docker-build vars: - FILE: production + FILE: ferretdb/production TARGET: production-binary PLATFORM: linux/amd64,linux/arm64,linux/arm/v7 # TODO https://github.com/FerretDB/FerretDB/issues/3354 OUTPUT: type=local,dest=tmp/build @@ -812,7 +812,7 @@ tasks: - bin/envtool{{exeExt}} shell mkdir tmp/rpms - task: docker-build vars: - FILE: development + FILE: ferretdb/development TARGET: development-binary PLATFORM: linux/amd64,linux/arm64,linux/arm/v7 # TODO https://github.com/FerretDB/FerretDB/issues/3354 OUTPUT: type=local,dest=tmp/build @@ -840,7 +840,7 @@ tasks: - bin/envtool{{exeExt}} shell mkdir tmp/rpms - task: docker-build vars: - FILE: production + FILE: ferretdb/production TARGET: production-binary PLATFORM: linux/amd64,linux/arm64,linux/arm/v7 # TODO https://github.com/FerretDB/FerretDB/issues/3354 OUTPUT: type=local,dest=tmp/build diff --git a/build/docker/buildkitd.toml b/build/buildkitd.toml similarity index 100% rename from build/docker/buildkitd.toml rename to build/buildkitd.toml diff --git a/build/docker/all-in-one.Dockerfile b/build/ferretdb/all-in-one.Dockerfile similarity index 100% rename from build/docker/all-in-one.Dockerfile rename to build/ferretdb/all-in-one.Dockerfile diff --git a/build/docker/all-in-one/entrypoint.sh b/build/ferretdb/all-in-one/entrypoint.sh similarity index 100% rename from build/docker/all-in-one/entrypoint.sh rename to build/ferretdb/all-in-one/entrypoint.sh diff --git a/build/docker/all-in-one/ferretdb.sh b/build/ferretdb/all-in-one/ferretdb.sh similarity index 100% rename from build/docker/all-in-one/ferretdb.sh rename to build/ferretdb/all-in-one/ferretdb.sh diff --git a/build/docker/all-in-one/postgresql.sh b/build/ferretdb/all-in-one/postgresql.sh similarity index 100% rename from build/docker/all-in-one/postgresql.sh rename to build/ferretdb/all-in-one/postgresql.sh diff --git a/build/docker/development.Dockerfile b/build/ferretdb/development.Dockerfile similarity index 100% rename from build/docker/development.Dockerfile rename to build/ferretdb/development.Dockerfile diff --git a/build/docker/group b/build/ferretdb/group similarity index 100% rename from build/docker/group rename to build/ferretdb/group diff --git a/build/docker/passwd b/build/ferretdb/passwd similarity index 100% rename from build/docker/passwd rename to build/ferretdb/passwd diff --git a/build/docker/production.Dockerfile b/build/ferretdb/production.Dockerfile similarity index 100% rename from build/docker/production.Dockerfile rename to build/ferretdb/production.Dockerfile From 403f558b61f190499c7bef894a7f73c625540cfb Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Wed, 13 Mar 2024 18:07:04 +0400 Subject: [PATCH 2/2] Fix paths --- .dockerignore | 2 +- build/ferretdb/all-in-one.Dockerfile | 6 +++--- build/ferretdb/production.Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.dockerignore b/.dockerignore index 05f4d3cec301..ffd99b9c50c4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,4 +14,4 @@ !.gitignore # additional files for Docker images -!build/docker +!build/ferretdb diff --git a/build/ferretdb/all-in-one.Dockerfile b/build/ferretdb/all-in-one.Dockerfile index 719936b14a70..cee32ec18926 100644 --- a/build/ferretdb/all-in-one.Dockerfile +++ b/build/ferretdb/all-in-one.Dockerfile @@ -111,9 +111,9 @@ RUN mkdir /tmp/cover # all-in-one hacks start there -COPY --from=all-in-one-build /src/build/docker/all-in-one/ferretdb.sh /etc/service/ferretdb/run -COPY --from=all-in-one-build /src/build/docker/all-in-one/postgresql.sh /etc/service/postgresql/run -COPY --from=all-in-one-build /src/build/docker/all-in-one/entrypoint.sh /entrypoint.sh +COPY --from=all-in-one-build /src/build/ferretdb/all-in-one/ferretdb.sh /etc/service/ferretdb/run +COPY --from=all-in-one-build /src/build/ferretdb/all-in-one/postgresql.sh /etc/service/postgresql/run +COPY --from=all-in-one-build /src/build/ferretdb/all-in-one/entrypoint.sh /entrypoint.sh RUN --mount=type=cache,sharing=locked,target=/var/cache/apt <