Latest Posts

Portainer and Docker Usage



Install Docker and Portainer

By default, Portainer store its data inside the container in the /data folder on Linux (C:\\data on Windows).
You’ll need to persist Portainer data to keep your changes after restart/upgrade of the Portainer container. You can use a bind mount on Linux to persist the data on the Docker host folder:



[email protected]:/# curl -sSL https://get.docker.com/ | sh


[email protected]:/# docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:latest
00754dc1b66c469edd162c4993a0d63fe6ce14f01a928c34bad98f955071f297

[email protected]:/# find . -type d -name "portainer_data" ./var/lib/docker/volumes/portainer_data


Update Portainer


[email protected]:/# docker stop portainer
portainer
[email protected]:/# docker pull portainer/portianer
Using default tag: latest
Error response from daemon: pull access denied for portainer/portianer, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
[email protected]:/# docker pull portainer/portainer
Using default tag: latest
latest: Pulling from portainer/portainer
d1e017099d17: Already exists
292b789be2e4: Pull complete
Digest: sha256:63eb47d4b408c3f39e942368bcbf7e157a2b6e5dda94ffd403a14199e1137133
Status: Downloaded newer image for portainer/portainer:latest
docker.io/portainer/portainer:latest
[email protected]:/# docker start portainer
portainer



Delete Container



[email protected]:/# docker container rm 4cf95554b471
Error response from daemon: You cannot remove a running container 4cf95554b471baa13e15e016a19ceacfdd7d2cb0e5ee5d0d5be837c521168691. Stop the container before attempting removal or force remove
[email protected]:/# docker stop portainer
portainer
[email protected]:/# docker container rm 4cf95554b471
4cf95554b471
[email protected]:/# docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:latest
00754dc1b66c469edd162c4993a0d63fe6ce14f01a928c34bad98f955071f297
[email protected]:/#




Check Container



[email protected]:/# docker container ls -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
a9ea9891aa03        nginx:latest        "nginx -g 'daemon of…"   4 weeks ago         Up 4 weeks          0.0.0.0:80->80/tcp       nginx1
4cf95554b471        4cda95efb0e4        "/portainer"             4 weeks ago         Up 11 minutes       0.0.0.0:9000->9000/tcp   portainer


[email protected]:/# docker stats
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
a9ea9891aa03        nginx1              0.00%               3.172MiB / 982.2MiB   0.32%               64.1MB / 132MB      14.6MB / 0B         3
4cf95554b471        portainer           0.01%               11.3MiB / 982.2MiB    1.15%               4.55MB / 50.2MB     90.7MB / 238MB      10





Other Docker Commands



Commands

















No comments