skip to Main Content

How can I hide the portainer container from the Portainer’s container list?

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    Inside a console, run:

    docker pull portainer/portainer-ce:latest && 
    echo "FROM portainer/portainer-ce:latest" | docker build --label hidden="true" -t "portainer/portainer-ce:latest" -
    

    This will create a new image of Portainer, with the label hidden="true" applied.

    Then, re-install the Portainer's docker container:

    docker stop portainer && 
    docker rm portainer && 
    docker run -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
    

    Open Portainer at http://localhost:8000, go to "Settings" (bottom left), at the "Hidden containers" section, and add an entry with name=hidden, value=true:

    enter image description here

    Now the portainer's container won't be visible at the containers list.


  2. Here is how you can do it without destroying and rebuilding your existing container.

    Go to the container and see what labels are assigned to the container. By default, the only label installed to portainer on the initial setup is io.portainer.server with a value of true.

    Go to Settings > Settings > Hidden Containers and add the label name of io.portainer.server with a value of true. Click +Add filter.

    When you go back to your containers list, you will no longer see the Portainer container. The dashboard will also no longer count it as one of the countainers in its statistics. It will still be listed as a volume and an image.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search