Skip to content

Instantly share code, notes, and snippets.

@Azer5C74
Last active March 26, 2023 13:14
Show Gist options
  • Save Azer5C74/0fb20bd2cbfe8d8afbc64c2aa125b134 to your computer and use it in GitHub Desktop.
Save Azer5C74/0fb20bd2cbfe8d8afbc64c2aa125b134 to your computer and use it in GitHub Desktop.
Portainer is a good alternative for docker desktop when working under Linux. Here is a small descriptive on how to get it ready to run on your machine.

This command runs a Docker container named "portainer" based on the "portainer/portainer-ce:latest" Docker image.

docker run -d -p 66666:8000 -p 66667:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

1. The "-d" flag

starts the container in the background. The "-p" flag binds two container ports (8000 and 9000) to two host ports (66666 and 66667) respectively, allowing access to the portainer web interface from outside the container.

2. The "--name" flag

sets the name of the container as "portainer". The "--restart" flag ensures that the container is always restarted automatically if it stops or if the Docker daemon is restarted.

3. The "-v" flag

mounts two volumes, "/var/run/docker.sock" and "portainer_data". The first volume allows the container to access the Docker socket on the host, which is needed for managing the Docker environment. The second volume is used to persist data generated by the portainer application.

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