2020-12-23 11:53:09 +01:00
|
|
|
FROM golang:1.15.6
|
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}
|
|
|
|
|
2021-01-11 12:08:17 +01:00
|
|
|
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb"
|
2019-02-19 05:51:37 +01:00
|
|
|
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
|
|
|
|
|