FROM golang:1.17

RUN go install golang.org/x/tools/cmd/cover@latest \
    && go install golang.org/x/lint/golint@latest

ENV REGISTRY_COMMIT=a<PASSWORD>db5a<PASSWORD>0c96dd6<PASSWORD>dbef4f<PASSWORD>1
RUN set -x \
	&& mkdir -p /go/src/github.com/distribution && cd /go/src/github.com/distribution \
	&& git clone https://github.com/distribution/distribution.git && cd distribution \
	&& git checkout "$REGISTRY_COMMIT" \
	&& make binaries && cp bin/registry /usr/local/bin

# The source is bind-mounted into this folder
WORKDIR /go/src/github.com/estesp/manifest-tool
