-
dockerfile 命令筆記 entrypoint 與 cmd,當(dāng)有entrypoint指定容器入口時(shí),就以他指定的端口執(zhí)行命令了。 exposure 暴露端口查看全部
-
docker build -t hello_docker . 其中,-t參數(shù)表示image的標(biāo)簽,也就是名字查看全部
-
docker rm 刪除已經(jīng)退出的container,使之在docker ps -a中不顯示。 docker run 以后得長(zhǎng)串字符串。實(shí)際為容器的id查看全部
-
不受環(huán)境影響,讓程序變得單純
查看全部 -
version: '3.1'
networks:
? ghost:
services:
? nginx:
? ? build: nginx
? ? networks:
? ? ? - ghost
? ? ports:
? ? ? - "80:80"
? ? depends_on:
? ? ? - ghost-app
? ghost-app:
? ? build: ghost
? ? networks:
? ? ? - ghost
? ? depends_on:
? ? ? - db
? ? restart: always
? ? ports:
? ? ? - 2368:2368
? ? environment:
? ? ? # see https://ghost.org/docs/config/#configuration-options
? ? ? database__client: mysql
? ? ? database__connection__host: db
? ? ? database__connection__user: root
? ? ? database__connection__password: example
? ? ? database__connection__database: ghost
? ? ? # this url value is just an example, and is likely wrong for your environment!
? ? ? # url: http://localhost:8080
? ? ? # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
? ? ? #NODE_ENV: development
? db:
? ? image: mysql:5.7
? ? restart: always
? ? networks:
? ? ? - ghost
? ? volumes:
? ? ? - $PWD/data:/var/lib/mysql
? ? ports:
? ? ? - "3306:3306"
? ? environment:
? ? ? MYSQL_ROOT_PASSWORD: example
FROM ghost:3-alpine
EXPOSE 2368
FROM nginx
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
worker_processes 4;
events {
? ? worker_connections 1024;
}
http {
? ? server {
? ? ? ? listen 80;
? ? ? ? location / {
? ? ? ? ? ? proxy_pass http://ghost-app:2368;
? ? ? ? }
? ? }
}
查看全部 -
查看全部
-
粗糙的理解為輕量級(jí)虛擬機(jī)查看全部
-
修改鏡像地址
查看全部 -
docker命令
查看全部 -
輕量的虛擬機(jī)查看全部
-
docker build? -t? hello_docker? ?.
-t :給構(gòu)建的鏡像打一個(gè)標(biāo)簽,tag;
hello_docker :構(gòu)建后的標(biāo)簽名;
.? :使用當(dāng)前目錄下的 Dockerfile 文件構(gòu)建鏡像;
查看全部 -
docker exec -it 容器名 bash
查看全部 -
docker 加速鏡像
科大鏡像:https://docker.mirrors.ustc.edu.cn/
網(wǎng)易:https://hub-mirror.c.163.com/
阿里云:https://<你的ID>.mirror.aliyuncs.com
七牛云加速器:https://reg-mirror.qiniu.com
查看全部
舉報(bào)