-
-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15ece72
commit 93743aa
Showing
12 changed files
with
212 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
sudo apt-get install docker-ce-cli binfmt-support qemu-user-static | ||
|
||
BUILDX_BINARY_URL="https://github.com/docker/buildx/releases/download/v0.4.2/buildx-v0.4.2.linux-amd64" | ||
|
||
curl --output docker-buildx \ | ||
--silent --show-error --location --fail --retry 3 \ | ||
"$BUILDX_BINARY_URL" | ||
|
||
mkdir -p ~/.docker/cli-plugins | ||
mv docker-buildx ~/.docker/cli-plugins | ||
chmod a+x ~/.docker/cli-plugins/docker-buildx | ||
|
||
# We need this to get arm64 qemu to work https://github.com/docker/buildx/issues/138#issuecomment-569240559 | ||
docker run --privileged --rm docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 | ||
if ! docker buildx inspect ddev-builder-multi --bootstrap >/dev/null; then docker buildx create --name ddev-builder-multi; fi | ||
docker buildx use ddev-builder-multi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# In CI environments, use the plain Docker build progress to not overload the CI logs | ||
PROGRESS := $(if $(CI),plain,auto) | ||
|
||
SANITIZED_DOCKER_REPO = $(subst /,_,$(DOCKER_REPO)) | ||
|
||
DOTFILE_IMAGE = $(subst /,_,$(IMAGE))-$(VERSION) | ||
|
||
container: .container-$(DOTFILE_IMAGE) container-name | ||
|
||
.container-$(DOTFILE_IMAGE): $(wildcard Dockerfile Dockerfile.in) container-name | ||
# UPSTREAM_REPO in the Dockerfile.in will be changed to the value from Makefile; this is deprecated. | ||
# There's no reason not to just use Dockerfile now. | ||
@if [ -f Dockerfile.in ]; then sed -e 's|UPSTREAM_REPO|$(UPSTREAM_REPO)|g' Dockerfile.in > .dockerfile; else cp Dockerfile .dockerfile; fi | ||
# Add information about the commit into .docker_image, to be added to the build. | ||
@echo "$(DOCKER_REPO):$(VERSION) commit=$(shell git describe --tags --always)" >.docker_image | ||
# Add the .docker_image into the build so it's easy to figure out where a docker image came from. | ||
@echo "ADD .docker_image /$(SANITIZED_DOCKER_REPO)_VERSION_INFO.txt" >>.dockerfile | ||
docker buildx build --platform linux/amd64 --progress=$(PROGRESS) -o type=docker -t $(DOCKER_REPO):$(VERSION) $(DOCKER_ARGS) -f .dockerfile . | ||
@docker images -q $(DOCKER_REPO):$(VERSION) >$@ | ||
|
||
container-name: | ||
@echo "container: $(DOCKER_REPO):$(VERSION)" | ||
|
||
push: | ||
docker buildx build --push --platform $(BUILD_ARCHS) --progress=$(PROGRESS) -t $(DOCKER_REPO):$(VERSION) $(DOCKER_ARGS) -f .dockerfile . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.