3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 MAINTAINER Balint Varga <balint.varga@nokia.com>
19 ENV REGISTRY_VERSION=$REGISTRY
21 ENV PATH /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
23 ENV DOCKER_BUILDTAGS include_oss include_gcs
25 WORKDIR ${GOPATH}/src/github.com/docker/distribution
26 COPY common_scripts/wait-for-files /usr/bin/
29 RUN adduser -u 149 -D -H -s /sbin/nologin dockerreg \
30 && chmod +x /mainstart.sh /usr/bin/wait-for-files \
32 && apk add --no-cache --virtual .build-deps build-base go godep git curl tar \
33 && curl -fsSL -k https://github.com/docker/distribution/archive/v${REGISTRY_VERSION}.tar.gz | tar zx --strip-components=1 \
35 && make PREFIX=/build clean binaries \
36 && mv ${GOPATH}/src/github.com/docker/distribution/bin/registry /usr/bin/ \
38 && apk del .build-deps \
42 ENTRYPOINT ["/mainstart.sh"]