我在这样的docker容器中运行Jenkins
Foo(const int& initialValue) :
m_array(make_array<NumItems>(Bar<NumPieces>{ initialValue }))
{}
这是我的Jenkinsfile
version: '3.4'
services:
redis:
image: redis:alpine
ports:
- 6379:6379
jenkins:
image: jenkinsci/blueocean
user: root
ports:
- "8080:8080"
volumes:
- ./jenkins_data:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
答案 0 :(得分:1)
version: '3'
不起作用。
但是
version: '2'
有效
这是我的考验
32 image: daocloud.io/mysql:5.7.21
33 ports:
34 - "3306:3306"
35 volumes:
36 - ./my.cnf:/etc/mysql/my.cnf
37 environment:
38 - MYSQL_ROOT_PASSWORD=dangerous
39 mysql3307:
40 image: daocloud.io/mysql:5.6
41 ports:
42 - "3307:3306"
43 environment:
44 - MYSQL_ROOT_PASSWORD=dangerous
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a5317caa2a56 daocloud.io/mysql:5.7.21 "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:3306->3306/tcp service_mysql_1
9c5e3f2750f9 daocloud.io/mysql:5.6 "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:3307->3306/tcp service_mysql3307_1
在9c5e3f2750f9中,我运行它
mysql -u root -pdangerous -h mysql
它可以工作,但是当我将版本更改为“ 3”时。
Warning: Using a password on the command line interface can be insecure.
ERROR 2005 (HY000): Unknown MySQL server host 'msyql' (0)