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

feat: add multiple docker images #2440

Merged
merged 2 commits into from
Aug 18, 2022
Merged

Conversation

niccoloraspa
Copy link
Member

Continues: #2427

What is the purpose of the change

This PR adds additional flavors to the osmosis Docker image.
Now you can run the osmosisd binary from:

All images have amd64 and arm64 support.
I have also changed the default docker image from static:nonroot to static.

Why all of this

Distroless container images are IMHO the best way to run a golang binary. However, nonroot images have created permission problems in the past. To simplify, I'm proposing to use static distroless images as our default but still offer the possibility to run a nonroot Docker image via the -nonroot suffix.

Distroless images contain, by design, only the binary and no shell.
This limitation led to the proliferation of various spurious Docker images created ad-hoc to solve specific problems.
Introducing alpine images could help reduce the number of Docker images we have: #1679, and it can be helpful in dev/testing scenarios.

Brief Changelog

  • Change the default runner Docker image to gcr.io/distroless/static
  • Modify Docker workflow to push multiple osmosisd docker images with the same binary.

Testing and Verifying

I have tested the workflow from my fork: https://github.com/niccoloraspa/osmosis/actions/runs/2875632534.
Triggered the workflow by creating a fake tag v12.12.22 that pushed the following images in the osmolabs/osmosis-test registry.

docker run osmolabs/osmosis-test:12.12.22
docker run osmolabs/osmosis-test:12.12.22-alpine
docker run osmolabs/osmosis-test:12.12.22-distroless
docker run osmolabs/osmosis-test:12.12.22-nonroot

# Also osmolabs/osmosis-test:12, osmolabs/osmosis-test:12.12, osmolabs/osmosis-test:latest 

Documentation and Release Note

  • Does this pull request introduces a new feature or user-facing behavior changes? no
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? no
  • How is the feature or change documented? not applicable

@niccoloraspa niccoloraspa requested a review from a team August 18, 2022 10:42
@@ -13,8 +13,7 @@ RUN set -eux; apk add --no-cache ca-certificates build-base; apk add git linux-h

# Download go dependencies
WORKDIR /osmosis
COPY go.mod go.mod
COPY go.sum go.sum
COPY go.* .
Copy link
Member Author

Choose a reason for hiding this comment

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

☝️ @p0mvn <3

@ValarDragon ValarDragon merged commit 4b5eccf into main Aug 18, 2022
@ValarDragon ValarDragon deleted the nicco/add-multiple-docker-images branch August 18, 2022 12:34
@p0mvn p0mvn added the A:backport/v11.x backport patches to v11.x branch label Aug 18, 2022
mergify bot pushed a commit that referenced this pull request Aug 18, 2022
* Change default image && copy all go deps in 1 layer

* Extend workflow to push multiple docker images

(cherry picked from commit 4b5eccf)

# Conflicts:
#	Dockerfile
ValarDragon pushed a commit that referenced this pull request Aug 19, 2022
* feat: add multiple docker images (#2440)

* Change default image && copy all go deps in 1 layer

* Extend workflow to push multiple docker images

(cherry picked from commit 4b5eccf)

# Conflicts:
#	Dockerfile

* Fix conflicts

Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com>
Co-authored-by: Niccolo Raspa <nraspa@live.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v11.x backport patches to v11.x branch T:build T:CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants