Skip to content

Commit

Permalink
Use alpine as base image for building simd. (cosmos#4067)
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
  • Loading branch information
2 people authored and colin-axner committed Jul 18, 2023
1 parent 4c84db6 commit 6778020
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
FROM golang:1.20 as builder

FROM golang:1.20-alpine3.18 as builder
ARG IBC_GO_VERSION

RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;

ENV GOPATH=""
ENV GOMODULE="on"

# ensure the ibc go version is being specified for this image.
RUN test -n "${IBC_GO_VERSION}"

COPY go.mod .
COPY go.sum .

RUN go mod download

# Copy relevant files before go mod download. Replace directives to local paths break if local
# files are not copied before go mod download.
ADD internal internal
ADD testing testing
ADD modules modules
Expand All @@ -21,15 +19,19 @@ ADD LICENSE LICENSE
COPY contrib/devtools/Makefile contrib/devtools/Makefile
COPY Makefile .

COPY go.mod .
COPY go.sum .

RUN make build
RUN go mod download

FROM ubuntu:22.04
RUN BUILD_TAGS=muslc make build

FROM alpine:3.18
ARG IBC_GO_VERSION

LABEL "org.cosmos.ibc-go" "${IBC_GO_VERSION}"

COPY --from=builder /go/build/simd /bin/simd

ENTRYPOINT ["simd"]

0 comments on commit 6778020

Please sign in to comment.