diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8f51f8a5d0e..955bd5fe19d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -44,8 +44,9 @@ jobs: file: Dockerfile context: . push: true - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} + - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e7cf561f2aa..b815fadd4c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1253] Add lockup duration edit method * [#1312] Stableswap: Createpool logic * [#1230] Stableswap CFMM equations +* [#1541] Add arm64 support to Docker ## [v8.0.0 - Emergency proposals upgrade](https://github.com/osmosis-labs/osmosis/releases/tag/v8.0.0) diff --git a/Dockerfile b/Dockerfile index 5fc92efd277..7bfa136b2b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,36 @@ # syntax=docker/dockerfile:1 -ARG BASE_IMG_TAG=nonroot +ARG BASE_IMG_TAG=nonroot + +# -------------------------------------------------------- +# Build +# -------------------------------------------------------- -## Build Image FROM golang:1.18.2-alpine3.15 as build RUN set -eux; apk add --no-cache ca-certificates build-base; - RUN apk add git - -# needed by github.com/zondax/hid +# Needed by github.com/zondax/hid RUN apk add linux-headers WORKDIR /osmosis COPY . /osmosis -# 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/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a -RUN sha256sum /lib/libwasmvm_muslc.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479 +# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a +RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 7d2239e9f25e96d0d4daba982ce92367aacf0cbd95d2facb8442268f2b1cc1fc +RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479 + +# CosmWasm: copy the right library according to architecture. The final location will be found by the linker flag `-lwasmvm_muslc` +RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a RUN BUILD_TAGS=muslc LINK_STATICALLY=true make build -## Deploy image +# -------------------------------------------------------- +# Runner +# -------------------------------------------------------- + FROM gcr.io/distroless/base-debian11:${BASE_IMG_TAG} COPY --from=build /osmosis/build/osmosisd /bin/osmosisd @@ -35,4 +43,3 @@ EXPOSE 26657 EXPOSE 1317 ENTRYPOINT ["osmosisd"] -CMD [ "start" ] \ No newline at end of file