docker輕量級(jí)管理工具

首先安裝docker并啟動(dòng)

wget https://download.docker.com/linux/centos/docker-ce.repo

mv docker-ce.repo /etc/yum.repos.d

yum install -y docker-ce

systemctl start docker && systemctl enable docker && systemctl status docker

安裝成功后 就拉取鏡像
安裝Docker之后,運(yùn)行以下命令以獲取最新的Portainer映像?!?br> [root@localhost ~]# docker search portainer

拉取鏡像

[root@localhost ~]# docker pull portainer/portainer
Using default tag: latest
latest: Pulling from portainer/portainer
d1e017099d17: Pull complete
292b789be2e4: Pull complete
Digest: sha256:63eb47d4b408c3f39e942368bcbf7e157a2b6e5dda94ffd403a14199e1137133
Status: Downloaded newer image for portainer/portainer:latest
docker.io/portainer/portainer:latest

查看鏡像

[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
portainer/portainer latest d1219c88aa21 2 weeks

啟動(dòng)
[root@localhost ~]# docker run -d -p 9000:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name prtainer-test portainer/portainer

該語(yǔ)句用宿主機(jī)9000端口關(guān)聯(lián)容器中的9000端口,并給容器起名為portainer-test。執(zhí)行完該命令之后,使用該機(jī)器IP:PORT即可訪問(wèn)Portainer

image.png

第一次要?jiǎng)?chuàng)建密碼 密碼必須大于8個(gè)字符?。?!


image.png

單機(jī)版這里選擇local即可,選擇完畢,點(diǎn)擊Connect即可連接到本地docker


image.png

注意:該頁(yè)面上有提示需要掛載本地 /var/run/docker.socker與容器內(nèi)的/var/run/docker.socker連接。因此,在啟動(dòng)時(shí)必須指定該掛載文件。

image.png

接下來(lái)使用 創(chuàng)建容器 例如 mysql

單擊左側(cè)的“App Templates”按鈕。這將顯示一些現(xiàn)成的可用模板,例如Docker映像注冊(cè)表,Nginx,Httpd,MySQl,WordPress等。


image.png

選擇要部署的容器,只需單擊相應(yīng)的模板。

這里讓我們啟動(dòng)MySQL容器。為此,請(qǐng)單擊MySQL模板。輸入容器名稱,選擇網(wǎng)絡(luò)類型(例如新娘模式)。單擊“Show advanced options”并設(shè)置端口號(hào)。


image.png

點(diǎn)擊“Deploy the container”,過(guò)程會(huì)有點(diǎn)長(zhǎng),耐心等待。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容