2015-06-05 20:19:50 +00:00
|
|
|
# Docker Registry Integration Testing
|
2015-05-22 23:39:45 +00:00
|
|
|
|
2015-06-05 20:19:50 +00:00
|
|
|
These integration tests cover interactions between the Docker daemon and the
|
|
|
|
registry server. All tests are run using the docker cli.
|
|
|
|
|
|
|
|
The compose configuration is intended to setup a testing environment for Docker
|
2015-05-22 23:39:45 +00:00
|
|
|
using multiple registry configurations. These configurations include different
|
|
|
|
combinations of a v1 and v2 registry as well as TLS configurations.
|
|
|
|
|
2015-06-05 20:19:50 +00:00
|
|
|
## Running inside of Docker
|
|
|
|
### Get integration container
|
|
|
|
The container image to run the integation tests will need to be pulled or built
|
|
|
|
locally.
|
|
|
|
|
|
|
|
*Building locally*
|
|
|
|
```
|
2015-05-28 22:28:50 +00:00
|
|
|
$ docker build -t distribution/docker-integration .
|
2015-06-05 20:19:50 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Run script
|
|
|
|
|
|
|
|
Invoke the tests within Docker through the `run.sh` script.
|
|
|
|
|
|
|
|
```
|
2015-05-28 22:28:50 +00:00
|
|
|
$ ./run.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
Run with aufs driver and tmp volume
|
|
|
|
**NOTE: Using a volume will prevent multiple runs from needing to
|
|
|
|
re-pull images**
|
|
|
|
```
|
|
|
|
$ STORAGE_DRIVER=aufs DOCKER_VOLUME=/tmp/volume ./run.sh
|
2015-06-05 20:19:50 +00:00
|
|
|
```
|
2015-05-22 23:39:45 +00:00
|
|
|
|
2015-06-05 20:19:50 +00:00
|
|
|
## Running manually outside of Docker
|
2015-05-22 23:39:45 +00:00
|
|
|
|
|
|
|
### Install Docker Compose
|
|
|
|
|
2015-06-01 15:32:44 +00:00
|
|
|
[Docker Compose Installation Guide](http://docs.docker.com/compose/install/)
|
2015-05-22 23:39:45 +00:00
|
|
|
|
|
|
|
### Start compose setup
|
|
|
|
```
|
|
|
|
docker-compose up
|
|
|
|
```
|
|
|
|
|
|
|
|
### Install Certificates
|
2015-06-05 20:19:50 +00:00
|
|
|
The certificates must be installed in /etc/docker/cert.d in order to use TLS
|
|
|
|
client auth and use the CA certificate.
|
2015-05-22 23:39:45 +00:00
|
|
|
```
|
|
|
|
sudo sh ./install_certs.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
### Test with Docker
|
|
|
|
Tag an image as with any other private registry. Attempt to push the image.
|
|
|
|
|
|
|
|
```
|
|
|
|
docker pull hello-world
|
|
|
|
docker tag hello-world localhost:5440/hello-world
|
|
|
|
docker push localhost:5440/hello-world
|
|
|
|
|
|
|
|
docker tag hello-world localhost:5441/hello-world
|
|
|
|
docker push localhost:5441/hello-world
|
|
|
|
# Perform login using user `testuser` and password `passpassword`
|
|
|
|
```
|
|
|
|
|
2015-06-05 20:19:50 +00:00
|
|
|
### Set /etc/hosts entry
|
|
|
|
Find the non-localhost ip address of local machine
|
|
|
|
|
|
|
|
### Run bats
|
|
|
|
Run the bats tests after updating /etc/hosts, installing the certificates, and
|
|
|
|
running the `docker-compose` script.
|
|
|
|
```
|
|
|
|
bats -p .
|
|
|
|
```
|
|
|
|
|
2015-05-22 23:39:45 +00:00
|
|
|
## Configurations
|
|
|
|
|
|
|
|
Port | V2 | V1 | TLS | Authentication
|
|
|
|
--- | --- | --- | --- | ---
|
|
|
|
5000 | yes | yes | no | none
|
|
|
|
5001 | no | yes | no | none
|
|
|
|
5002 | yes | no | no | none
|
2015-06-05 20:19:50 +00:00
|
|
|
5011 | no | yes | yes | none
|
2015-05-22 23:39:45 +00:00
|
|
|
5440 | yes | yes | yes | none
|
|
|
|
5441 | yes | yes | yes | basic (testuser/passpassword)
|
|
|
|
5442 | yes | yes | yes | TLS client
|
|
|
|
5443 | yes | yes | yes | TLS client (no CA)
|
|
|
|
5444 | yes | yes | yes | TLS client + basic (testuser/passpassword)
|
|
|
|
5445 | yes | yes | yes (no CA) | none
|
|
|
|
5446 | yes | yes | yes (no CA) | basic (testuser/passpassword)
|
|
|
|
5447 | yes | yes | yes (no CA) | TLS client
|
|
|
|
5448 | yes | yes | yes (SSLv3) | none
|