Skip to content

Commit

Permalink
Improve Dockerfile (#1071)
Browse files Browse the repository at this point in the history
* Use nonroot docker image

* Update CHANGELOG.md
  • Loading branch information
Niccolo Raspa authored Mar 10, 2022
1 parent 9f64276 commit 8bbfd24
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Minor improvements & Bug Fixes

* [#1061](https://github.com/osmosis-labs/osmosis/pull/1061) upgrade iavl to v0.17.3-osmo-v5 with concurrent map write fix
* [#1071](https://github.com/osmosis-labs/osmosis/pull/1071) improve Dockerfile

### SDK fork updates

Expand Down
28 changes: 14 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# syntax=docker/dockerfile:1

## Build
## Build Image
FROM golang:1.17-bullseye as build

WORKDIR /osmosis
COPY . /osmosis
RUN make build

## Deploy
FROM gcr.io/distroless/base-debian11
# From https://github.com/CosmWasm/wasmd/blob/master/Dockerfile
# For more details see https://github.com/CosmWasm/wasmvm#builds-of-libwasmvm
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta7/libwasmvm_muslc.a /lib/libwasmvm_muslc.a
RUN sha256sum /lib/libwasmvm_muslc.a | grep d0152067a5609bfdfb3f0d5d6c0f2760f79d5f2cd7fd8513cafa9932d22eb350
RUN BUILD_TAGS=muslc make build

WORKDIR /
## Deploy image
FROM gcr.io/distroless/base-debian11:nonroot

# wasm dependencies
COPY --from=build /go/pkg/mod/github.com/!cosm!wasm/[email protected]/api/libwasmvm.so /lib/
COPY --from=build /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/
COPY --from=build /osmosis/build/osmosisd /bin/osmosisd

# osmosisd binary
COPY --from=build /osmosis/build/osmosisd /osmosisd
ENV HOME /osmosis
WORKDIR $HOME

EXPOSE 26656
EXPOSE 26656
EXPOSE 26657
EXPOSE 1317
EXPOSE 9090
EXPOSE 1317

ENTRYPOINT ["/osmosisd"]
ENTRYPOINT ["osmosisd"]

0 comments on commit 8bbfd24

Please sign in to comment.