Skip to content

Instantly share code, notes, and snippets.

@habibimustafa
Last active July 18, 2019 06:15
Show Gist options
  • Save habibimustafa/05e5d7893f796c9531ce7afb337d324f to your computer and use it in GitHub Desktop.
Save habibimustafa/05e5d7893f796c9531ce7afb337d324f to your computer and use it in GitHub Desktop.
Docker Portainer Installer
os ?= $(shell lsb_release -cs)
install-docker:;: '$(os)'
@apt-get update
@apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@apt-key fingerprint 0EBFCD88
@add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(os) stable"
@apt-get update
@apt-get install docker-ce -y
@apt-cache madison docker-ce
@docker run hello-world
@echo "============Docker has been Installed==============="
port-portainer ?= 9000:9000
install-portainer:;: '$(port-portainer)'
@docker volume create vol-portainer
@docker run -d --name Portainer --restart=always -p $(port-portainer) -v /var/run/docker.sock:/var/run/docker.sock -v vol-portainer:/data portainer/portainer
@echo "============Portainer has been Installed==============="
@habibimustafa
Copy link
Author

Portainer with SSL Enabled

docker volume create vol-portainer
docker run -d --name portainer --restart=always -p 9000:9000 \
	-v /var/run/docker.sock:/var/run/docker.sock \
	-v vol-portainer:/data \
	-v /etc/letsencrypt/live/<redacted>:/certs/live/<redacted>:ro \
	-v /etc/letsencrypt/archive/<redacted>:/certs/archive/<redacted>:ro \
	portainer/portainer --ssl --sslcert /certs/live/<redacted>/cert.pem --sslkey /certs/live/<redacted>/privkey.pem

Refs: portainer/portainer#986 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment