-
Notifications
You must be signed in to change notification settings - Fork 472
Docker Compose Environment
Important note: remember that this page refers to a development environment. For examples closer to production see this.
It is possible to use docker-compose to spin up a small development/demo environment. For that, you need docker-compose 1.6 or later. The environment consists of some Docker containers linked together:
- portus: this is the container running Portus. It's based on the official opensuse/ruby Docker image.
- db: this is the container running the database required by Portus. It's based on the official mariadb Docker image.
- registry: this is a the container running the latest version of the Docker registry (aka distribution). It's based on the official registry Docker image.
- webpack: a helper container that will set up the frontend environment automatically for you.
- background: the background process performs some needed tasks for the maintenance of Portus.
- clair: a CoreOS Clair process that you can use to test the security vulnerability feature.
- postgres: the database for clair.
This environment is meant for development/playground purposes. Known limitations:
- Portus uses a public and password-less certificate stored inside of this git repository.
- Registry is not secured, everything is transmitted over http.
- The Docker host has two open two ports in order to make Portus and the registry reachable.
If you want a more secure and production-ready example using docker-compose
, check the example in examples/compose
.
First of all ensure you have docker-compose installed. Note that this setup is known to fail on NFS. Then, make sure that the environment variables as defined in .env
are what you desire. After that, simply run:
$ docker-compose up
This will:
- Download the needed Docker images.
- Build the local images for development purpose.
- Initialize the DB
Once the setup is done there are a couple of manual operations to perform on Portus:
- Create your account. The first user is going to be an administrators. Administrators are special users, they can do everything, including pushing to the global namespace of your registry.
- Associate your on-premise instance of the Docker registry (e.g. with this setup you will get
<docker host>:5000
by default).
Portus' UI will be accessible on http://<docker host>:3000
.
Once the initial setup is done you can use docker-compose
to handle everything.
You can do:
-
docker-compose up
to start the whole environment -
docker-compose stop
to stop the whole environment
All the changes (database, registry) are stored into Docker volumes.