update readme and dockerfile

Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
Jess Frazelle 2017-04-10 14:37:33 +00:00
parent 57e5dcd240
commit aeff5763cc
3 changed files with 22 additions and 7 deletions

View file

@ -12,8 +12,8 @@ RUN apk add --no-cache \
xz
ENV DOCKER_BUCKET get.docker.com
ENV DOCKER_VERSION 17.03.0-ce
ENV DOCKER_SHA256 4a9766d99c6818b2d54dc302db3c9f7b352ad0a80a2dc179ec164a3ba29c2d3e
ENV DOCKER_VERSION 1.11.1
ENV DOCKER_SHA256 893e3c6e89c0cd2c5f1e51ea41bc2dd97f5e791fcfa3cee28445df277836339d
RUN set -x \
&& curl -fSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-$DOCKER_VERSION.tgz" -o docker.tgz \

View file

@ -58,15 +58,14 @@ DIND_DOCKER_IMAGE=r.j3ss.co/docker:userns
dind:
docker build --rm --force-rm -f Dockerfile.dind -t $(DIND_DOCKER_IMAGE) .
docker run -d \
--tmpfs /var/lib/docker \
-v /var/lib/docker2:/var/lib/docker \
--name $(DIND_CONTAINER) \
--privileged \
-v $(CURDIR)/.certs:/etc/docker/ssl \
-v $(CURDIR):/go/src/github.com/jessfraz/reg \
-v /tmp \
--tmpfs /tmp \
-v /tmp:/tmp \
$(DIND_DOCKER_IMAGE) \
dockerd -D --storage-driver $(DOCKER_GRAPHDRIVER) \
docker daemon -D --storage-driver $(DOCKER_GRAPHDRIVER) \
-H tcp://127.0.0.1:2375 \
--host=unix:///var/run/docker.sock \
--disable-legacy-registry=true \
@ -85,10 +84,11 @@ dtest:
-v $(CURDIR):/go/src/github.com/jessfraz/reg \
--workdir /go/src/github.com/jessfraz/reg \
-v $(CURDIR)/.certs:/etc/docker/ssl:ro \
--volumes-from $(DIND_CONTAINER) \
-v /tmp:/tmp \
--net container:$(DIND_CONTAINER) \
-e DOCKER_HOST=tcp://127.0.0.1:2375 \
-e DOCKER_TLS_VERIFY=true \
-e DOCKER_CERT_PATH=/etc/docker/ssl \
-e DOCKER_API_VERSION=1.23 \
$(DOCKER_IMAGE) \
make test

View file

@ -11,6 +11,7 @@ Docker registry v2 command line client.
- [Download a Layer](#download-a-layer)
- [Delete an Image](#delete-an-image)
- [Vulnerability Reports](#vulnerability-reports)
- [Testing](#testing)
## Usage
@ -155,3 +156,17 @@ Low: 3
Medium: 3
High: 1
```
## Testing
If you plan on contributing you should be able to run the tests locally. The
tests run for CI via docker-in-docker. But running locally with `go test`, you
need to make one modification to your docker daemon config so that you can talk
to the local registry for the tests.
Add the flag `--insecure-registry localhost:5000` to your docker daemon,
documented [here](https://docs.docker.com/registry/insecure/) for testing
against an insecure registry.
OR run `make dind dtest` to avoid having to change your local docker config and
to run the tests as docker-in-docker.