Run Portainer WebUI for Docker on a docker host built using Alpine (3.8) Linux
Despite documentation publicly available on Internet, Portainer is not specially well documented in regard to docker volumes and other similar stuff. Best approach is to handle ourselves the volumes mounted per container.
You need to have certificates already created to pass to the docker command line / docker composer. Easier way to have that certificates is to use selfsigned certificates. Following line creates a 10-year valid self-signed certificates:
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -keyout server.key -out server.crt
docker pull portainer/portainer-ce:alpine
docker run -d --restart unless-stopped -p 443:9000 --name portainer \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/opt/portainer/portainer_data:/data portainer/portainer \
--ssl --sslcert /data/ssl/server.crt \
--sslkey /data/ssl/server.key
-
where /data inside the container is mapped against /var/opt/portainer/portainer_data on the docker host.
-
thus /data/ssl directory used for certificates is in fact /var/opt/portainer/portainer_data/ssl on the docker host.