From 74cba2407f3c5999ab27597dde1643e7e748db8e Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Mon, 30 Sep 2024 16:14:26 -0400 Subject: [PATCH] ci: Move collab to Dockerfile-collab (#18515) This makes it possible to have multiple Dockerfiles, each with their own `.dockerignore`. Previously any docker builds would always include anything inside `.dockerignore`. I believe this feature may require `export DOCKER_BUILDKIT=1` but we use that in CI already. --- .github/workflows/deploy_collab.yml | 6 +++++- .zed/settings.json | 4 ++++ Dockerfile => Dockerfile-collab | 0 .dockerignore => Dockerfile-collab.dockerignore | 0 4 files changed, 9 insertions(+), 1 deletion(-) rename Dockerfile => Dockerfile-collab (100%) rename .dockerignore => Dockerfile-collab.dockerignore (100%) diff --git a/.github/workflows/deploy_collab.yml b/.github/workflows/deploy_collab.yml index c4193adcd2..1e6e6cf280 100644 --- a/.github/workflows/deploy_collab.yml +++ b/.github/workflows/deploy_collab.yml @@ -76,7 +76,11 @@ jobs: clean: false - name: Build docker image - run: docker build . --build-arg GITHUB_SHA=$GITHUB_SHA --tag registry.digitalocean.com/zed/collab:$GITHUB_SHA + run: | + docker build -f Dockerfile-collab \ + --build-arg GITHUB_SHA=$GITHUB_SHA \ + --tag registry.digitalocean.com/zed/collab:$GITHUB_SHA \ + . - name: Publish docker image run: docker push registry.digitalocean.com/zed/collab:${GITHUB_SHA} diff --git a/.zed/settings.json b/.zed/settings.json index 176fd33a9b..41adfdbf59 100644 --- a/.zed/settings.json +++ b/.zed/settings.json @@ -38,6 +38,10 @@ } } }, + "file_types": { + "Dockerfile": ["Dockerfile*[!dockerignore]"], + "Git Ignore": ["dockerignore"] + }, "hard_tabs": false, "formatter": "auto", "remove_trailing_whitespace_on_save": true, diff --git a/Dockerfile b/Dockerfile-collab similarity index 100% rename from Dockerfile rename to Dockerfile-collab diff --git a/.dockerignore b/Dockerfile-collab.dockerignore similarity index 100% rename from .dockerignore rename to Dockerfile-collab.dockerignore