Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build setup image
run: make build

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Show Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to AWS public ECR
run: make login
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_PUBLIC_ECR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PUBLIC_ECR_SECRET_ACCESS_KEY }}
- name: Push setup image
run: make push

- name: Build and push image
run: make build-push-multiplatform
18 changes: 15 additions & 3 deletions .github/workflows/release_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,29 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Extract tag
id: extract_tag
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/v})"

- name: Print tag
run: echo "Running release build for ${{ steps.extract_tag.outputs.tag }}"
- name: Build kubernetes-setup
run: make build BUILD_TAG=${{ steps.extract_tag.outputs.tag }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Show Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to AWS public ECR
run: make login
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_PUBLIC_ECR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PUBLIC_ECR_SECRET_ACCESS_KEY }}

- name: Push kubernetes-setup image
run: make push BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
run: make build-push-multiplatform BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
FROM alpine:3.13

ENV TERRAFORM_VERSION=0.13.6
ARG TARGETPLATFORM

RUN apk add --no-cache \
bash \
curl \
jq \
&& apk upgrade \
&& curl -o terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then TERRAFORM_PLATFORM="linux_amd64"; fi; \
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then TERRAFORM_PLATFORM="linux_arm"; fi; \
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then TERRAFORM_PLATFORM="linux_arm64"; fi; \
if [ "${TERRAFORM_PLATFORM}" = "" ]; then TERRAFORM_PLATFORM="${TARGETPLATFORM}"; fi \
&& curl -o terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TERRAFORM_PLATFORM}.zip \
&& unzip terraform.zip \
&& mv terraform /usr/local/bin/ \
&& rm terraform.zip \
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ push:
login:
aws ecr-public get-login-password --region us-east-1 \
| docker login --username AWS --password-stdin $(ECR_URL)

build-push-multiplatform:
docker buildx build \
--push \
--platform linux/amd64,linux/arm/v7,linux/arm64 \
--build-arg BUILD_TAG=$(BUILD_TAG) \
--tag $(REPO_URL):$(BUILD_TAG) \
.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# sumologic-kubernetes-setup

Setup image for the [Sumologic Kubernetes Collection](https://github.com/SumoLogic/sumologic-kubernetes-collection)

The images are pushed to [public.ecr.aws/sumologic/kubernetes-setup](https://gallery.ecr.aws/sumologic/kubernetes-setup).

The images are built for the following architectures:

- `linux/amd64`
- `linux/arm/v7`
- `linux/arm64/v8`

## Build

To build image only for the build host's architecture:

```shell
make build
```

To build multi-platform image and push it to a registry:

```shell
make build-push-multiplatform REPO_URL=my-repo/setup BUILD_TAG=custom-tag
```