This project will help you to:
- Access docker containers via Traefik: reverse proxy and load balancer for containers
- Manage and inspect docker via Portainer
- docker-compose
- A local DNS resolver to point some test domains to localhost
See Resources.
Clone the liip/pontsun repository anywhere. Then cd
to the working copy.
Create an envfile
cp ./containers/.env.example ./containers/.env
Adapt the ./containers/.env
file as needed.
Create certificates for HTTPS
USER_ID=$(id -u) docker-compose -f docker-compose.certificates.yml up
You can add the fake root CA authority certificate certificates/docker.test.rootCA.crt
to your browser authorities in order to let it trust the concerned local developement instances.
cd containers
docker-compose up -d
To use an ssh key from your host in your docker container, start the ssh-agent with
cd containers
docker-compose -f docker-compose.yml -f docker-compose.ssh-agent.yml up -d
You can also add the following to your containers/.env
file instead
COMPOSE_FILE=docker-compose.yml:docker-compose.ssh-agent.yml
This may only be needed on OS X.
It assumes, you don't run your stuff as root. If you do, you can leave the socat stuff out.
KEY=id_rsa
docker run --rm --volumes-from=pontsun_ssh_agent -v ~/.ssh/$KEY:/.ssh/$KEY -it nardeas/ssh-agent ssh-add -l
if [[ $? == 1 ]]; then
docker run --rm --volumes-from=pontsun_ssh_agent -v ~/.ssh/$KEY:/.ssh/$KEY -it nardeas/ssh-agent ssh-add /root/.ssh/id_rsa
fi
docker-compose exec -d $YOUR_CONTAINER ./socat.sh
docker-compose exec $YOUR_CONTAINER sudo chown $YOUR_USER /home/$YOUR_USER/.ssh/socket
and socat.sh is:
sudo killall socat 2&> /dev/null
sudo rm -f $HOME/.ssh/socket
sudo socat UNIX-LISTEN:$HOME/.ssh/socket,fork UNIX-CONNECT:/.ssh-agent/socket
- Traefik: reverse proxy and load balancer for containers
- Portainer: GUI for Docker management