馬克思似乎在想像,只要消滅了資本家,全世界就會變成一個雅典市集(Athenian agora)。只要取消機器和土地的私有制,人類就不再會自私自利,就會從此和諧地共同生活。 --Leszek Kolakowski
但是私有是人類天性,用docker不自己管私有image,就代表用的不夠深入人性。
建立私有儲存很快,像我要把它放在ssd上就是
docker run -d -p 5000:5000 -v /media/nvme0n1p1/storage:/var/lib/registry --name registry registry:2
具體的作法
icekimo@Kris:~$ sudo mkdir /media/nvme0n1p1/registry
icekimo@Kris:~$ sudo docker run -d -p 5000:5000 -v /media/nvme0n1p1/storage:/var/lib/registry --name registry registry:2
Unable to find image 'registry:2' locally
2: Pulling from library/registry
c87736221ed0: Pull complete
1cc8e0bb44df: Pull complete
54d33bcb37f5: Pull complete
e8afc091c171: Pull complete
b4541f6d3db6: Pull complete
Digest: sha256:8004747f1e8cd820a148fb7499d71a76d45ff66bac6a29129bfdbfdc0154d146
Status: Downloaded newer image for registry:2
e5d39198730e7a93cd7f41f7626338505d4c1e9449a1098aede5048947668e4b
icekimo@Kris:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e5d39198730e registry:2 "/entrypoint.sh /etc…" 4 seconds ago Up 3 seconds 0.0.0.0:5000->5000/tcp registry
255531a6efde portainer/portainer "/portainer" 4 hours ago Up 4 hours 0.0.0.0:8000->8000/tcp, 0.0.0.0:9000->9000/tcp boring_poincare
icekimo@Kris:~$
不過我們來看看要用的話可以怎麼用portainer.io幫忙?先找出IP
註冊一個registry
OK就出現了
補一下剛剛忘記的--restart=always
push的時候有私人區可以存放了