Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Latest commit

 

History

History
26 lines (18 loc) · 756 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 756 Bytes

Create a lightweight goose docker image

Goose binary build

Since the goose dependency package go-sqlite3 is base on cgo, we cannot set CGO_ENABLED=0

HINT: -ldflags "-extldflags -static"

FROM golang:alpine AS build-env

RUN set -ex \
        && apk add --no-cache --virtual build-dependencies \
            build-base \
            git \
        && go get -ldflags "-extldflags -static" bitbucket.org/liamstask/goose/cmd/goose \
        && apk del build-dependencies

FROM alpine

COPY --from=build-env /go/bin/goose /usr/local/bin/goose

ENTRYPOINT ["/usr/local/bin/goose"]
CMD ["--help"]