-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker相关 #114
Comments
**docker exec :**在运行的容器中执行命令 语法docker exec [OPTIONS] CONTAINER COMMAND [ARG...] OPTIONS说明:
实例在容器mynginx中以交互模式执行容器内/root/runoob.sh脚本 runoob@runoob:~$ docker exec -it mynginx /bin/sh /root/runoob.sh 在容器mynginx中开启一个交互模式的终端 runoob@runoob:~$ docker exec -i -t mynginx /bin/bash |
docker run --name tomcat -p 8080:8080 -v $PWD/test:/usr/local/tomcat/webapps/test -d tomcat docker run -p 3306:3306 --name mymysql -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql docker run -p 3306:3306 --name mymysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql docker mysql 密码 ABC123*&^ 172.17.0.1 docker-machine env itgoyo 192.168.99.100 docker-machine ssh itgoyo docker exec -it f163f6e95096 bash mysql允许远程登录 my-secret-pw docker run --name dockermysql -p 3307:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql docker run --name dockermysql -p 3307:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7.23 注意尽量不要使用3306换其他的端口 |
搞了一个早上都没有结果、后面这个命令先命名后映射端口号就可以成功连接了。 |
将主机./RS-MapReduce目录拷贝到容器30026605dcfe的/home/cloudera目录下。
将容器
|
/usr/sbin/netdata 运行netdata |
当前目录:容器目录
先
docker ps -l
查看当前的所有容器,如果有重名的可以先使用docker rm id
但要记得
rm
之前要先stop
命令说明:
-p 8080:8080:将容器的8080端口映射到主机的8080端口
-v $PWD/test:/usr/local/tomcat/webapps/test:将主机中当前目录下的test挂载到容器的/test
The text was updated successfully, but these errors were encountered: