mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 12:15:20 +01:00
08a4d8efd2
We should use a golang that isn't having security issues. This includes: * go1.14.6 (released 2020/07/16) includes fixes to the go command, the compiler, the linker, vet, and the database/sql, encoding/json, net/http, reflect, and testing packages. See the Go 1.14.6 milestone on our issue tracker for details. * go1.14.7 (released 2020/08/06) includes security fixes to the encoding/binary package. See the Go 1.14.7 milestone on our issue tracker for details (CVE-2020-16845) Signed-off-by: Dirk Mueller <dirk@dmllr.de> Signed-off-by: Dirk Mueller <dmueller@suse.com>
31 lines
1.4 KiB
Docker
31 lines
1.4 KiB
Docker
FROM golang:1.14.7
|
|
|
|
ARG NOTARY_VERSION
|
|
ARG MIGRATE_VERSION
|
|
RUN test -n "$NOTARY_VERSION"
|
|
RUN test -n "$MIGRATE_VERSION"
|
|
ENV NOTARYPKG github.com/theupdateframework/notary
|
|
ENV MIGRATEPKG github.com/golang-migrate/migrate
|
|
|
|
RUN git clone -b $NOTARY_VERSION https://github.com/theupdateframework/notary.git /go/src/${NOTARYPKG}
|
|
WORKDIR /go/src/${NOTARYPKG}
|
|
|
|
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
|
|
|
|
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
|
|
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
|
|
|