2020-03-11 05:20:06 +01:00
|
|
|
FROM golang:1.13.8
|
2017-09-26 11:14:13 +02:00
|
|
|
|
2019-02-19 05:51:37 +01:00
|
|
|
ARG NOTARY_VERSION
|
|
|
|
ARG MIGRATE_VERSION
|
|
|
|
RUN test -n "$NOTARY_VERSION"
|
|
|
|
RUN test -n "$MIGRATE_VERSION"
|
2017-12-09 19:53:12 +01:00
|
|
|
ENV NOTARYPKG github.com/theupdateframework/notary
|
2019-02-19 05:51:37 +01:00
|
|
|
ENV MIGRATEPKG github.com/golang-migrate/migrate
|
2017-09-26 11:14:13 +02:00
|
|
|
|
2019-02-19 05:51:37 +01:00
|
|
|
RUN git clone -b $NOTARY_VERSION https://github.com/theupdateframework/notary.git /go/src/${NOTARYPKG}
|
2017-09-26 11:14:13 +02:00
|
|
|
WORKDIR /go/src/${NOTARYPKG}
|
|
|
|
|
2017-12-09 19:53:12 +01:00
|
|
|
RUN go install -tags pkcs11 \
|
|
|
|
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" ${NOTARYPKG}/cmd/notary-server
|
2017-09-26 11:14:13 +02:00
|
|
|
|
2017-12-09 19:53:12 +01:00
|
|
|
RUN go install -tags pkcs11 \
|
|
|
|
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" ${NOTARYPKG}/cmd/notary-signer
|
2019-02-19 05:51:37 +01:00
|
|
|
RUN cp -r /go/src/${NOTARYPKG}/migrations/ /
|
|
|
|
|
|
|
|
RUN git clone -b $MIGRATE_VERSION https://github.com/golang-migrate/migrate /go/src/${MIGRATEPKG}
|
|
|
|
WORKDIR /go/src/${MIGRATEPKG}
|
|
|
|
|
|
|
|
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && chmod +x /usr/local/bin/dep
|
|
|
|
RUN dep ensure -vendor-only
|
|
|
|
|
|
|
|
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse"
|
|
|
|
ENV SOURCES="file go_bindata github aws_s3 google_cloud_storage"
|
|
|
|
|
|
|
|
RUN go install -tags "$DATABASES $SOURCES" -ldflags="-X main.Version=${MIGRATE_VERSION}" ${MIGRATEPKG}/cli && mv /go/bin/cli /go/bin/migrate
|
|
|
|
|