mirror of
https://github.com/containers/skopeo.git
synced 2025-10-21 19:03:44 +00:00
This reduces the time used to clone openshift/origin on Travis from > real 2m34.227s > user 4m18.844s > sys 0m8.144s to > real 0m8.816s > user 0m2.640s > sys 0m0.856s , and the download size from 782.78 MiB to 70.05 MiB . We can't trivially do this for docker/distribution because it is using (git checkout $commit) on the cloned repo; we could do a clone+fetch+fetch with --depth=1, but the full clone takes less than two seconds, so let's keep that one simple.
45 lines
2.2 KiB
Docker
45 lines
2.2 KiB
Docker
FROM fedora
|
|
|
|
RUN dnf -y update && dnf install -y make git golang golang-github-cpuguy83-go-md2man \
|
|
# storage deps
|
|
btrfs-progs-devel \
|
|
device-mapper-devel \
|
|
# gpgme bindings deps
|
|
libassuan-devel gpgme-devel \
|
|
ostree-devel \
|
|
gnupg
|
|
|
|
# Install two versions of the registry. The first is an older version that
|
|
# only supports schema1 manifests. The second is a newer version that supports
|
|
# both. This allows integration-cli tests to cover push/pull with both schema1
|
|
# and schema2 manifests.
|
|
ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
|
|
ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
|
|
RUN set -x \
|
|
&& export GOPATH="$(mktemp -d)" \
|
|
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
|
|
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
|
|
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
|
|
go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
|
|
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
|
|
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
|
|
go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
|
|
&& rm -rf "$GOPATH"
|
|
|
|
RUN set -x \
|
|
&& yum install -y which git tar wget hostname util-linux bsdtar socat ethtool device-mapper iptables tree findutils nmap-ncat e2fsprogs xfsprogs lsof docker iproute \
|
|
&& export GOPATH=$(mktemp -d) \
|
|
&& git clone --depth 1 -b v1.5.0-alpha.3 git://github.com/openshift/origin "$GOPATH/src/github.com/openshift/origin" \
|
|
&& (cd "$GOPATH/src/github.com/openshift/origin" && make clean build && make all WHAT=cmd/dockerregistry) \
|
|
&& cp -a "$GOPATH/src/github.com/openshift/origin/_output/local/bin/linux"/*/* /usr/local/bin \
|
|
&& cp "$GOPATH/src/github.com/openshift/origin/images/dockerregistry/config.yml" /atomic-registry-config.yml \
|
|
&& mkdir /registry
|
|
|
|
ENV GOPATH /usr/share/gocode:/go
|
|
ENV PATH $GOPATH/bin:/usr/share/gocode/bin:$PATH
|
|
RUN go get github.com/golang/lint/golint
|
|
WORKDIR /go/src/github.com/projectatomic/skopeo
|
|
COPY . /go/src/github.com/projectatomic/skopeo
|
|
|
|
#ENTRYPOINT ["hack/dind"]
|