Skip to content

Commit

Permalink
Add docker buildx make target (#3213)
Browse files Browse the repository at this point in the history
* Add docker buildx make target

Signed-off-by: Pavol Loffay <[email protected]>

* Remove space

Signed-off-by: Pavol Loffay <[email protected]>

* make it idempotent

Signed-off-by: Pavol Loffay <[email protected]>

* fix hotrod

Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored Aug 18, 2021
1 parent 10c5743 commit 8d2ac60
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 49 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/ci-all-in-one-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
jobs:
all-in-one:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- uses: actions/[email protected]
with:
Expand All @@ -39,10 +34,6 @@ jobs:

- uses: docker/setup-qemu-action@v1

- uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host

- name: Build, test, and publish all-in-one image
run: bash scripts/build-all-in-one-image.sh
env:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/ci-crossdock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
jobs:
crossdock:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
strategy:
matrix:
steps:
Expand Down Expand Up @@ -41,10 +36,6 @@ jobs:

- uses: docker/setup-qemu-action@v1

- uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host

- name: Build, test, and publish ${{ matrix.steps.name }} image
run: ${{ matrix.steps.cmd }}
env:
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ jobs:
docker-images:
runs-on: ubuntu-latest

services:
registry:
image: registry:2
ports:
- 5000:5000

steps:
- uses: actions/[email protected]
with:
Expand All @@ -41,10 +35,6 @@ jobs:

- uses: docker/setup-qemu-action@v1

- uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host

- name: Build and upload all docker images
run: bash scripts/build-upload-docker-images.sh
env:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/ci-hotrod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
jobs:
hotrod:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- uses: actions/[email protected]
with:
Expand All @@ -35,10 +30,6 @@ jobs:

- uses: docker/setup-qemu-action@v1

- uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host

- name: Build, test, and publish hotrod image
run: bash scripts/hotrod-integration-test.sh
env:
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ on:
jobs:
publish-release:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000


steps:
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -57,10 +52,6 @@ jobs:

- uses: docker/setup-qemu-action@v1

- uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host

- name: Build and upload all docker images
run: bash scripts/build-upload-docker-images.sh
env:
Expand Down
14 changes: 12 additions & 2 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,25 @@ PLATFORMS := linux/amd64,linux/s390x,linux/ppc64le,linux/arm64

create-baseimg-debugimg: create-baseimg create-debugimg

create-baseimg:
create-baseimg: prepare-docker-buildx
docker buildx build -t $(BASE_IMAGE) --push \
--build-arg root_image=$(ROOT_IMAGE) \
--build-arg cert_image=$(CERT_IMAGE) \
--platform=$(PLATFORMS) \
docker/base

create-debugimg:
create-debugimg: prepare-docker-buildx
docker buildx build -t $(DEBUG_IMAGE) --push \
--build-arg golang_image=$(GOLANG_IMAGE) \
--platform=$(PLATFORMS) \
docker/debug

.PHONY: prepare-docker-buildx
prepare-docker-buildx:
docker buildx inspect jaeger-build > /dev/null || docker buildx create --use --name=jaeger-build --buildkitd-flags="--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host" --driver-opt="network=host"
docker inspect registry > /dev/null || docker run --rm -d -p 5000:5000 --name registry registry:2

.PHONY: clean-docker-buildx
clean-docker-buildx:
docker buildx rm jaeger-build
docker rm -f registry
1 change: 1 addition & 0 deletions scripts/hotrod-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ make build-examples GOOS=linux GOARCH=arm64

REPO=jaegertracing/example-hotrod
platforms="linux/amd64,linux/s390x,linux/ppc64le,linux/arm64"
make prepare-docker-buildx
#build image locally for integration test
bash scripts/build-upload-a-docker-image.sh -l -c example-hotrod -d examples/hotrod -p "${platforms}"

Expand Down

0 comments on commit 8d2ac60

Please sign in to comment.