Skip to content

Instantly share code, notes, and snippets.

@Bucephalus-lgtm
Created February 12, 2023 06:10
Show Gist options
  • Save Bucephalus-lgtm/ecff63b698e92d31bc37cc8d7b4ea871 to your computer and use it in GitHub Desktop.
Save Bucephalus-lgtm/ecff63b698e92d31bc37cc8d7b4ea871 to your computer and use it in GitHub Desktop.

The basic flow is this:

First build the Docker image and then run it in Portainer.

Steps:

  • Build the Docker image:
 docker build -t <__your_image_name__>
  • Launch Portainer:
  docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer
  • Login to Portainer: Access the Portainer web interface by navigating to http://localhost:9000 in your favorite web browser. Then login using default credentails (username: admin and password: admin)
  • Create a new container:
    • Go to Containers on left side
    • Click on Add Container button
    • Select <your_image_name>
    • Choose a name for your container
    • Map the exposed port(here, 3000) in Dockerfile
    • Here you can see Containers and Add container: Portainer
  • Now, you can simply start the container
  • Done, thus you can manage your docker image and container in Portainer ✅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment