Skip to content

Commit

Permalink
feat: push container images to Docker Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
kasia-kujawa committed Apr 18, 2024
1 parent 441c871 commit ed347d2
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ env:
ECR_URL: public.ecr.aws/sumologic
SIDECAR_IMAGE_ECR: "public.ecr.aws/sumologic/tailing-sidecar-dev"
OPERATOR_IMAGE_ECR: "public.ecr.aws/sumologic/tailing-sidecar-operator-dev"
SIDECAR_IMAGE_DOCKERHUB: "sumologic/tailing-sidecar-dev"
OPERATOR_IMAGE_DOCKERHUB: "sumologic/tailing-sidecar-operator-dev"
LATEST_TAG: "main"

jobs:
Expand Down Expand Up @@ -48,6 +50,7 @@ jobs:
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

- name: Log in to AWS Public ECR to publish tailing sidecar image
run: make login-ecr
env:
Expand All @@ -66,6 +69,23 @@ jobs:
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_LOGIN_TAILING_SIDECAR_DEV }}
password: ${{ secrets.DOCKERHUB_PASSWORD_TAILING_SIDECAR_DEV }}
- name: Build and push tailing sidecar multiplatform image
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Build and push tailing sidecar ubi image
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar image with latest tag
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

build-otelcol-sidecar:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -96,6 +116,11 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_TAILING_SIDECAR_OTEL_DEV }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_TAILING_SIDECAR_OTEL_DEV }}
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_LOGIN_TAILING_SIDECAR_OTEL_DEV }}
password: ${{ secrets.DOCKERHUB_PASSWORD_TAILING_SIDECAR_OTEL_DEV }}
- name: Build and push otelcol sidecar image
run: |
make install-builder
Expand Down Expand Up @@ -139,6 +164,7 @@ jobs:
- name: Push tailing sidecar operator ubi image with latest tag
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./operator

- name: Log in to AWS Public ECR to publish tailing sidecar operator image
run: make login-ecr
env:
Expand All @@ -157,6 +183,24 @@ jobs:
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./operator

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_LOGIN_TAILING_SIDECAR_OPERATOR_DEV }}
password: ${{ secrets.DOCKERHUB_PASSWORD_TAILING_SIDECAR_OPERATOR_DEV }}
- name: Build and push tailing sidecar operator multiplatform image
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Build and push tailing sidecar operator ubi image
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Push tailing sidecar operator image with latest tag
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./operator
- name: Push tailing sidecar operator ubi image with latest tag
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./operator

push-helm-chart:
runs-on: ubuntu-20.04
steps:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/release_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ env:
ECR_URL: public.ecr.aws/sumologic
SIDECAR_IMAGE_ECR: "public.ecr.aws/sumologic/tailing-sidecar"
OPERATOR_IMAGE_ECR: "public.ecr.aws/sumologic/tailing-sidecar-operator"
SIDECAR_IMAGE_DOCKERHUB: "sumologic/tailing-sidecar"
OPERATOR_IMAGE_DOCKERHUB: "sumologic/tailing-sidecar-operator"
LATEST_TAG: "latest"

jobs:
Expand Down Expand Up @@ -47,6 +49,7 @@ jobs:
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

- name: Log in to AWS Public ECR to publish tailing sidecar image
run: make login-ecr
env:
Expand All @@ -65,6 +68,24 @@ jobs:
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_LOGIN_TAILING_SIDECAR }}
password: ${{ secrets.DOCKERHUB_PASSWORD_TAILING_SIDECAR }}
- name: Build and push tailing sidecar multiplatform image
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Build and push tailing sidecar ubi image
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar image with latest tag
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

build-operator:
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -102,6 +123,7 @@ jobs:
- name: Push tailing sidecar operator ubi image with latest tag
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./operator

- name: Log in to AWS Public ECR to publish tailing sidecar operator image
run: make login-ecr
env:
Expand All @@ -120,6 +142,24 @@ jobs:
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./operator

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_LOGIN_TAILING_SIDECAR_OPERATOR }}
password: ${{ secrets.DOCKERHUB_PASSWORD_TAILING_SIDECAR_OPERATOR }}
- name: Build and push tailing sidecar operator multiplatform image
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Build and push tailing sidecar operator ubi image
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Push tailing sidecar operator image with latest tag
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./operator
- name: Push tailing sidecar operator ubi image with latest tag
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./operator

push-helm-chart:
runs-on: ubuntu-20.04
steps:
Expand Down
13 changes: 13 additions & 0 deletions sidecar/otelcol/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project_name: otelcol-sidecar
env:
- GHCR_IMAGE={{ if index .Env "GHCR_IMAGE" }}{{ .Env.GHCR_IMAGE }}{{ else }}ghcr.io/sumologic/tailing-sidecar-otel{{ end }}
- ECR_IMAGE={{ if index .Env "ECR_IMAGE" }}{{ .Env.ECR_IMAGE }}{{ else }}public.ecr.aws/sumologic/tailing-sidecar-otel{{ end }}
- DOCKERHUB_IMAGE={{ if index .Env "ECR_IMAGE" }}{{ .Env.ECR_IMAGE }}{{ else }}sumologic/tailing-sidecar-otel{{ end }}

before:
hooks:
Expand All @@ -38,6 +39,8 @@ dockers:
- "{{ .Env.ECR_IMAGE }}:main-amd64"
- "{{ .Env.GHCR_IMAGE }}:{{ .Version }}-amd64"
- "{{ .Env.GHCR_IMAGE }}:main-amd64"
- "{{ .Env.DOCKERHUB_IMAGE }}:{{ .Version }}-amd64"
- "{{ .Env.DOCKERHUB_IMAGE }}:main-amd64"
use: buildx
goarch: amd64
build_flag_templates:
Expand All @@ -49,6 +52,8 @@ dockers:
- "{{ .Env.ECR_IMAGE }}:main-arm64"
- "{{ .Env.GHCR_IMAGE }}:{{ .Version }}-arm64"
- "{{ .Env.GHCR_IMAGE }}:main-arm64"
- "{{ .Env.DOCKERHUB_IMAGE }}:{{ .Version }}-arm64"
- "{{ .Env.DOCKERHUB_IMAGE }}:main-arm64"
use: buildx
goarch: arm64
build_flag_templates:
Expand All @@ -73,6 +78,14 @@ docker_manifests:
image_templates:
- "{{ .Env.ECR_IMAGE }}:main-amd64"
- "{{ .Env.ECR_IMAGE }}:main-arm64"
- name_template: "{{ .Env.DOCKERHUB_IMAGE }}:{{ .Version }}"
image_templates:
- "{{ .Env.DOCKERHUB_IMAGE }}:{{ .Version }}-amd64"
- "{{ .Env.DOCKERHUB_IMAGE }}:{{ .Version }}-arm64"
- name_template: "{{ .Env.DOCKERHUB_IMAGE }}:main"
image_templates:
- "{{ .Env.DOCKERHUB_IMAGE }}:main-amd64"
- "{{ .Env.DOCKERHUB_IMAGE }}:main-arm64"

# we only want to build and publish docker images
release:
Expand Down
1 change: 1 addition & 0 deletions sidecar/otelcol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ release-dev: ensure-correct-builder-version install-goreleaser
GORELEASER_CURRENT_TAG=$(TAG) \
ECR_IMAGE=public.ecr.aws/sumologic/tailing-sidecar-otel-dev \
GHCR_IMAGE=ghcr.io/sumologic/tailing-sidecar-otel \
DOCKERHUB_IMAGE=sumologic/tailing-sidecar-otel-dev \
make release
git tag -d "$(TAG)"

Expand Down

0 comments on commit ed347d2

Please sign in to comment.