-
docker search : 从Docker Hub查找镜像
docker search java
docker search node
docker search mysql
-
编写
yaml
文件:
version: "3"
services:
mysql:
image: mysql:latest
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: 111111
volumes:
- ./data:/var/lib/mysql
- ./conf/my.cnf:/etc/my.cnf
ports:
- "3306:3306"
java:
image: java:latest
container_name: java
ports:
- "8663:8663"
depends_on:
- mysql
restart: always
volumes:
- ./conf/application.properties:/usr/local/conf/application.properties
node:
container_name: node
image: node:latest
ports:
- "9100:9100"
depends_on:
- java
restart: always
- 执行命令:
$ docker-compose -f deploy.yaml up -d
网友评论