Skip to content

Commit

Permalink
Make the dockerfile compatible with m1 (arm64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunnini committed Dec 10, 2021
1 parent 679d073 commit b796f3b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
10 changes: 6 additions & 4 deletions localnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ FROM ubuntu:20.04
RUN apt-get update && apt-get install -y git build-essential wget
RUN wget https://github.com/mikefarah/yq/releases/download/v4.9.3/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq

RUN wget https://dl.google.com/go/go1.15.10.linux-amd64.tar.gz
RUN tar -xvf go1.15.10.linux-amd64.tar.gz
RUN mv go /usr/local
COPY install-golang.sh install-golang.sh

RUN sh install-golang.sh

ENV GOROOT /usr/local/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
ENV GOPATH /go
ENV GOBIN /go/bin
ENV PATH $GOBIN:$GOROOT/bin:$PATH

RUN git clone https://github.com/osmosis-labs/osmosis

Expand Down
14 changes: 14 additions & 0 deletions localnet/install-golang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/bash -x
set -e

GOLANG_URL=https://dl.google.com/go/go1.17.3.linux-amd64.tar.gz
GOLANG_FILENAME=go1.17.3.linux-amd64.tar.gz

if [ "aarch64" = $(uname -m) ]; then
GOLANG_URL=https://dl.google.com/go/go1.17.3.linux-arm64.tar.gz
GOLANG_FILENAME=go1.17.3.linux-arm64.tar.gz
fi

wget $GOLANG_URL
tar -xvf $GOLANG_FILENAME
mv go /usr/local

0 comments on commit b796f3b

Please sign in to comment.