Skip to content

Commit

Permalink
chore: build operator images based on UBI 8 Minimal (#1127)
Browse files Browse the repository at this point in the history
  • Loading branch information
prakhar-aqua committed Apr 12, 2022
1 parent d3072b5 commit 7562f68
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 1 deletion.
80 changes: 80 additions & 0 deletions .goreleaser.yaml
Expand Up @@ -37,6 +37,7 @@ builds:
- arm
- arm64
- s390x
- ppc64le
goarm:
- "7"
- id: starboard-scanner-aqua
Expand Down Expand Up @@ -110,6 +111,25 @@ dockers:
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.documentation=https://aquasecurity.github.io/starboard/v{{ .Version }}/"
- "--platform=linux/amd64"
- image_templates:
- "docker.io/aquasec/starboard-operator:{{ .Version }}-ubi8-amd64"
use: buildx
goos: linux
dockerfile: build/starboard-operator-ubi8/Dockerfile.ubi8
goarch: amd64
ids:
- starboard-operator
build_flag_templates:
- "--label=org.opencontainers.image.title=starboard-operator"
- "--label=org.opencontainers.image.description=Keeps Starboard resources updated"
- "--label=org.opencontainers.image.vendor=Aqua Security"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.source=https://github.com/aquasecurity/starboard"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.documentation=https://aquasecurity.github.io/starboard/v{{ .Version }}/"
- "--platform=linux/amd64"

- image_templates:
- "docker.io/aquasec/starboard-scanner-aqua:{{ .Version }}-amd64"
use: buildx
Expand Down Expand Up @@ -164,6 +184,24 @@ dockers:
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.documentation=https://aquasecurity.github.io/starboard/v{{ .Version }}/"
- "--platform=linux/arm64"
- image_templates:
- "docker.io/aquasec/starboard-operator:{{ .Version }}-ubi8-arm64"
use: buildx
goos: linux
dockerfile: build/starboard-operator-ubi8/Dockerfile.ubi8
goarch: amd64
ids:
- starboard-operator
build_flag_templates:
- "--label=org.opencontainers.image.title=starboard-operator"
- "--label=org.opencontainers.image.description=Keeps Starboard resources updated"
- "--label=org.opencontainers.image.vendor=Aqua Security"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.source=https://github.com/aquasecurity/starboard"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.documentation=https://aquasecurity.github.io/starboard/v{{ .Version }}/"
- "--platform=linux/arm64"
- image_templates:
- "docker.io/aquasec/starboard-scanner-aqua:{{ .Version }}-arm64"
use: buildx
Expand Down Expand Up @@ -218,6 +256,24 @@ dockers:
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.documentation=https://aquasecurity.github.io/starboard/v{{ .Version }}/"
- "--platform=linux/s390x"
- image_templates:
- "docker.io/aquasec/starboard-operator:{{ .Version }}-ubi8-s390x"
use: buildx
goos: linux
dockerfile: build/starboard-operator-ubi8/Dockerfile.ubi8
goarch: s390x
ids:
- starboard-operator
build_flag_templates:
- "--label=org.opencontainers.image.title=starboard-operator"
- "--label=org.opencontainers.image.description=Keeps Starboard resources updated"
- "--label=org.opencontainers.image.vendor=Aqua Security"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.source=https://github.com/aquasecurity/starboard"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.documentation=https://aquasecurity.github.io/starboard/v{{ .Version }}/"
- "--platform=linux/s390x"
- image_templates:
- "docker.io/aquasec/starboard-scanner-aqua:{{ .Version }}-s390x"
use: buildx
Expand All @@ -236,6 +292,24 @@ dockers:
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.documentation=https://aquasecurity.github.io/starboard/v{{ .Version }}/"
- "--platform=linux/s390x"
- image_templates:
- "docker.io/aquasec/starboard-operator:{{ .Version }}-ubi8-ppc64le"
use: buildx
goos: linux
dockerfile: build/starboard-operator-ubi8/Dockerfile.ubi8
goarch: ppc64le
ids:
- starboard-operator
build_flag_templates:
- "--label=org.opencontainers.image.title=starboard-operator"
- "--label=org.opencontainers.image.description=Keeps Starboard resources updated"
- "--label=org.opencontainers.image.vendor=Aqua Security"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.source=https://github.com/aquasecurity/starboard"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.documentation=https://aquasecurity.github.io/starboard/v{{ .Version }}/"
- "--platform=linux/ppc64le"
docker_manifests:
- name_template: "aquasec/starboard:{{ .Version }}"
image_templates:
Expand All @@ -252,3 +326,9 @@ docker_manifests:
- "aquasec/starboard-scanner-aqua:{{ .Version }}-amd64"
- "aquasec/starboard-scanner-aqua:{{ .Version }}-arm64"
- "aquasec/starboard-scanner-aqua:{{ .Version }}-s390x"
- name_template: "aquasec/starboard-operator:{{ .Version }}-ubi8"
image_templates:
- "aquasec/starboard-scanner-aqua:{{ .Version }}-ubi8-amd64"
- "aquasec/starboard-scanner-aqua:{{ .Version }}-ubi8-arm64"
- "aquasec/starboard-scanner-aqua:{{ .Version }}-ubi8-s390x"
- "aquasec/starboard-scanner-aqua:{{ .Version }}-ubi8-ppc64le"
7 changes: 6 additions & 1 deletion Makefile
Expand Up @@ -15,6 +15,7 @@ IMAGE_TAG := dev
STARBOARD_CLI_IMAGE := aquasec/starboard:$(IMAGE_TAG)
STARBOARD_OPERATOR_IMAGE := aquasec/starboard-operator:$(IMAGE_TAG)
STARBOARD_SCANNER_AQUA_IMAGE := aquasec/starboard-scanner-aqua:$(IMAGE_TAG)
STARBOARD_OPERATOR_IMAGE_UBI8 := aquasec/starboard-operator:$(IMAGE_TAG)-ubi8

MKDOCS_IMAGE := aquasec/mkdocs-material:starboard
MKDOCS_PORT := 8000
Expand Down Expand Up @@ -123,7 +124,7 @@ clean:

.PHONY: docker-build
## Builds Docker images for all binaries
docker-build: docker-build-starboard-cli docker-build-starboard-operator docker-build-starboard-scanner-aqua
docker-build: docker-build-starboard-cli docker-build-starboard-operator docker-build-starboard-scanner-aqua docker-build-starboard-operator-ubi8

## Builds Docker image for Starboard CLI
docker-build-starboard-cli: build-starboard-cli
Expand All @@ -132,6 +133,10 @@ docker-build-starboard-cli: build-starboard-cli
## Builds Docker image for Starboard operator
docker-build-starboard-operator: build-starboard-operator
docker build --no-cache -t $(STARBOARD_OPERATOR_IMAGE) -f build/starboard-operator/Dockerfile bin

## Builds Docker image for Starboard operator ubi8
docker-build-starboard-operator-ubi8: build-starboard-operator
docker build --no-cache -f build/starboard-operator-ubi8/Dockerfile.ubi8 -t $(STARBOARD_OPERATOR_IMAGE_UBI8) bin

## Builds Docker image for Aqua scanner
docker-build-starboard-scanner-aqua: build-starboard-scanner-aqua
Expand Down
10 changes: 10 additions & 0 deletions build/starboard-operator-ubi8/Dockerfile.ubi8
@@ -0,0 +1,10 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5

RUN microdnf install shadow-utils
RUN useradd -u 10000 starboard
WORKDIR /opt/bin/
COPY starboard-operator /usr/local/bin/starboard-operator

USER starboard

ENTRYPOINT ["starboard-operator"]

0 comments on commit 7562f68

Please sign in to comment.