Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update the makefile to push multi-arch images #319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ jobs:
<<: *defaults
steps:
- *attach_workspace
- setup_remote_docker
- setup_remote_docker:
version: 18.09.3
- run: mkdir -vp ~/.docker/cli-plugins/
- run: curl --silent -L --output ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-amd64
- run: chmod a+x ~/.docker/cli-plugins/docker-buildx
- run: docker buildx version
- run:
name: push sso-dev commit tag
command: |
Expand All @@ -55,6 +60,12 @@ jobs:
<<: *defaults
steps:
- *attach_workspace
- setup_remote_docker:
version: 18.09.3
- run: mkdir -vp ~/.docker/cli-plugins/
- run: curl --silent -L --output ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-amd64
- run: chmod a+x ~/.docker/cli-plugins/docker-buildx
- run: docker buildx version
- setup_remote_docker
- run:
name: push sso-dev latest tag
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ RUN cd cmd/sso-proxy/generate-request-signature && go build -mod=readonly -o /bi
# add static assets and copy binaries from build stage
# =============================================================================
FROM debian:stable-slim
RUN ln -s /usr/bin/dpkg-split /usr/sbin/dpkg-split
RUN ln -s /usr/bin/dpkg-deb /usr/sbin/dpkg-deb
RUN ln -s /bin/tar /usr/sbin/tar
RUN ln -s /bin/rm /usr/sbin/rm
Comment on lines +27 to +30
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was needed for the builds to complete. seems like the file locations are in different spots on the ARM arch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Would it be worth adding this in a quick inline comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this remains, yes. i want to test the resultant multi-arch images in a arm64 cluster before finalizing this. i only got to test it once during hackweek before tearing down the temp cluster.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm going to see if we need this for arm64, which is the primary secondary target we want for M1's and Graviton's

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that didn't work, these are needed for arm64 also apparently.

RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/* \
&& groupadd -r sso && useradd -r -g sso sso
WORKDIR /sso
Expand Down
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,25 @@ clean:
rm -r dist

imagepush-commit:
docker build -t buzzfeed/sso-dev:$(commit) .
docker push buzzfeed/sso-dev:$(commit)
docker context create sso-dev
docker buildx create sso-dev --name sso-dev
docker buildx use sso-dev
docker buildx build --tag buzzfeed/sso-dev:$(commit) . --platform linux/amd64,linux/arm64,linux/arm/v7 --push
docker buildx rm sso-dev

imagepush-latest:
docker build -t buzzfeed/sso-dev:latest .
docker push buzzfeed/sso-dev:latest
docker context create sso-dev
docker buildx create sso-dev --name sso-dev
docker buildx use sso-dev
docker buildx build --tag buzzfeed/sso-dev:latest . --platform linux/amd64,linux/arm64,linux/arm/v7 --push
docker buildx rm sso-dev

releasepush:
docker build -t buzzfeed/sso:$(version) -t buzzfeed/sso-dev:latest .
docker push buzzfeed/sso:$(version)
docker push buzzfeed/sso:latest
docker context create sso-dev
docker buildx create sso-dev --name sso-dev
docker buildx use sso-dev
docker buildx build --tag buzzfeed/sso:$(version) . --platform linux/amd64,linux/arm64,linux/arm/v7 --push
docker buildx build --tag buzzfeed/sso:latest . --platform linux/amd64,linux/arm64,linux/arm/v7 --push
docker buildx rm sso-dev

.PHONY: dist/sso-auth dist/sso-proxy tools