-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfile to use distroless base image (#869)
* Update Dockerfile to use distroless base image * Update CHANGELOG.md * Add dockerignore to reduce docker build size
- Loading branch information
Niccolo Raspa
authored
Feb 15, 2022
1 parent
b009588
commit 7343206
Showing
3 changed files
with
13 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
docs/ | ||
networks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,22 @@ | ||
FROM faddat/archlinux AS build | ||
# syntax=docker/dockerfile:1 | ||
|
||
ENV GOPATH=/go | ||
ENV PATH=$PATH:/go/bin | ||
## Build | ||
FROM golang:1.17-bullseye as build | ||
|
||
# Set up dependencies | ||
RUN pacman -Syyu --noconfirm curl make git go gcc linux-headers python base-devel protobuf wget && \ | ||
wget -O /genesis.json https://github.com/osmosis-labs/networks/raw/main/osmosis-1/genesis.json | ||
|
||
|
||
# Add source files | ||
WORKDIR /osmosis | ||
COPY . /osmosis | ||
RUN make build | ||
|
||
# Install minimum necessary dependencies, build Cosmos SDK, remove packages | ||
RUN cd /osmosis && \ | ||
make install | ||
|
||
# Final image | ||
FROM faddat/archlinux | ||
## Deploy | ||
FROM gcr.io/distroless/base-debian11 | ||
|
||
RUN pacman -Syyu --noconfirm | ||
WORKDIR / | ||
|
||
# Copy over binaries from the build-env | ||
COPY --from=build /go/bin/osmosisd /usr/bin/osmosisd | ||
COPY --from=build /genesis.json /genesis.json | ||
COPY --from=build /osmosis/build/osmosisd /osmosisd | ||
|
||
# Run osmosisd by default, omit entrypoint to ease using container with osmosiscli | ||
EXPOSE 26656 | ||
EXPOSE 26657 | ||
EXPOSE 1317 | ||
EXPOSE 9090 | ||
|
||
ENTRYPOINT ["/osmosisd"] |