forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Add Makefile and GitHub Actions workflow for new images
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
- Loading branch information
1 parent
fdb3323
commit 3680712
Showing
3 changed files
with
111 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Images | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- v[0-9]+.[0-9]+ | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ | ||
|
||
jobs: | ||
build-and-push: | ||
if: github.repository == 'cilium/cilium' | ||
name: Build and push all images | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: docker://docker.io/cilium/image-maker:bc81755ec8f6c5afcb10a416cef73f99a35fee2c | ||
name: Register binfmt from multi-platform builds | ||
with: | ||
entrypoint: docker | ||
args: run --privileged linuxkit/binfmt:5d33e7346e79f9c13a73c6952669e47a53b063d4 | ||
- uses: docker://docker.io/cilium/image-maker:bc81755ec8f6c5afcb10a416cef73f99a35fee2c | ||
name: Run make lint | ||
with: | ||
entrypoint: make | ||
args: -C images lint | ||
- uses: docker://docker.io/cilium/image-maker:bc81755ec8f6c5afcb10a416cef73f99a35fee2c | ||
name: Run make runtime-image | ||
env: | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
with: | ||
entrypoint: make | ||
# this will only get rebuilt when there changes in images/runtime | ||
args: -C images runtime-image PUSH=true | ||
- uses: docker://docker.io/cilium/image-maker:bc81755ec8f6c5afcb10a416cef73f99a35fee2c | ||
name: Run make builder-image | ||
env: | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
with: | ||
entrypoint: make | ||
# this will only get rebuilt when there changes in images/builder | ||
args: -C images builder-image PUSH=true | ||
- uses: docker://docker.io/cilium/image-maker:bc81755ec8f6c5afcb10a416cef73f99a35fee2c | ||
name: Run make cilium-image | ||
env: | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
with: | ||
entrypoint: make | ||
args: -C images cilium-image PUSH=true | ||
- uses: docker://docker.io/cilium/image-maker:bc81755ec8f6c5afcb10a416cef73f99a35fee2c | ||
name: Run make operator-image | ||
env: | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
with: | ||
entrypoint: make | ||
args: -C images operator-image PUSH=true | ||
- uses: docker://docker.io/cilium/image-maker:bc81755ec8f6c5afcb10a416cef73f99a35fee2c | ||
name: Run make hubble-relay-image | ||
env: | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
with: | ||
entrypoint: make | ||
args: -C images hubble-relay-image PUSH=true |
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,38 @@ | ||
# Copyright 2020 Authors of Cilium | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
REGISTRIES ?= docker.io/cilium | ||
# quay.io is not enabled, see https://github.com/cilium/image-tools/issues/11 | ||
# REGISTRIES ?= docker.io/cilium quay.io/cilium | ||
|
||
PUSH ?= false | ||
|
||
OUTPUT := "type=image" | ||
ifeq ($(PUSH),true) | ||
OUTPUT := "type=registry,push=true" | ||
endif | ||
|
||
all-images: lint runtime-image builder-image cilium-image operator-image hubble-relay-image | ||
|
||
lint: | ||
scripts/lint.sh | ||
|
||
.buildx_builder: | ||
# see https://github.com/docker/buildx/issues/308 | ||
mkdir -p ../.buildx | ||
docker buildx create --platform linux/amd64,linux/arm64 --buildkitd-flags '--debug' > $@ | ||
|
||
runtime-image: .buildx_builder | ||
TEST=true scripts/build-image.sh cilium-runtime-dev images/runtime linux/amd64,linux/arm64 $(OUTPUT) "$$(cat .buildx_builder)" $(REGISTRIES) | ||
|
||
builder-image: .buildx_builder | ||
TEST=true scripts/build-image.sh cilium-builder-dev images/builder linux/amd64 $(OUTPUT) "$$(cat .buildx_builder)" $(REGISTRIES) | ||
|
||
cilium-image: .buildx_builder | ||
ROOT_CONTEXT=true scripts/build-image.sh cilium-dev images/cilium linux/amd64,linux/arm64 $(OUTPUT) "$$(cat .buildx_builder)" $(REGISTRIES) | ||
|
||
operator-image: .buildx_builder | ||
ROOT_CONTEXT=true scripts/build-image.sh operator-dev images/operator linux/amd64,linux/arm64 $(OUTPUT) "$$(cat .buildx_builder)" $(REGISTRIES) | ||
|
||
hubble-relay-image: .buildx_builder | ||
ROOT_CONTEXT=true scripts/build-image.sh hubble-relay-dev images/hubble-relay linux/amd64,linux/arm64 $(OUTPUT) "$$(cat .buildx_builder)" $(REGISTRIES) |