Skip to content

Commit f5c7dc3

Browse files
committed
feat(*): use alpine:3.2 for image base
1 parent e162fda commit f5c7dc3

4 files changed

Lines changed: 43 additions & 2 deletions

File tree

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM alpine:3.2
2+
3+
ENV DOCKER_REGISTRY_TAG=v2.2.0 \
4+
DOCKER_REGISTRY_REPO=https://github.com/docker/distribution.git
5+
6+
# install registry binaries
7+
RUN export DISTRIBUTION_DIR=/go/src/github.com/docker/distribution \
8+
&& apk add --update-cache git go make \
9+
&& git clone -b $DOCKER_REGISTRY_TAG --single-branch $DOCKER_REGISTRY_REPO $DISTRIBUTION_DIR \
10+
&& cd $DISTRIBUTION_DIR \
11+
&& export GOPATH=/go:$DISTRIBUTION_DIR/Godeps/_workspace \
12+
&& make binaries \
13+
&& cp bin/* /bin/ \
14+
&& rm -rf /go \
15+
&& apk del --purge git go make \
16+
&& rm -rf /var/cache/apk/*
17+
18+
COPY rootfs/ /
19+
20+
# define the execution environment
21+
VOLUME ["/var/lib/registry"]
22+
EXPOSE 5000
23+
ENTRYPOINT ["/bin/registry"]
24+
CMD ["/etc/docker/registry/config.yml"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ build:
2727
# For cases where we're building from local
2828
# We also alter the RC file to set the image name.
2929
docker-build: check-docker
30-
docker build --rm -t ${IMAGE} rootfs
30+
docker build --rm -t ${IMAGE} .
3131

3232
# Push to a registry that Kubernetes can access.
3333
docker-push: check-docker check-registry

rootfs/Dockerfile

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 0.1
2+
log:
3+
fields:
4+
service: registry
5+
storage:
6+
cache:
7+
blobdescriptor: inmemory
8+
filesystem:
9+
rootdirectory: /var/lib/registry
10+
http:
11+
addr: :5000
12+
headers:
13+
X-Content-Type-Options: [nosniff]
14+
health:
15+
storagedriver:
16+
enabled: true
17+
interval: 10s
18+
threshold: 3

0 commit comments

Comments
 (0)