Skip to content

Instantly share code, notes, and snippets.

@ignaciolg
Created August 26, 2021 22:06
Show Gist options
  • Save ignaciolg/82adbc404487726dca4398f75ffa9a1e to your computer and use it in GitHub Desktop.
Save ignaciolg/82adbc404487726dca4398f75ffa9a1e to your computer and use it in GitHub Desktop.
Update Portainer to latest + add port label for traefik
#!/bin/sh
docker ps | grep -i portainer
CONTAINER=`docker ps | grep -i portainer | awk '{print $1}'`
docker stop $CONTAINER
docker rm $CONTAINER
docker run --label traefik.http.services.Portainer.loadbalancer.server.port=9000 -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment