mac动态添加端口号
摘要
点击查看更多
1 | docker pull elasticsearch:8.2.2 |
1 | docker network create elastic |
1 |
1 | docker run -it -d --name kibana --net elastic -p 5601:5601 kibana:8.2.2 |
docker cp kibana:/usr/share/kibana/config /Users/lizihan/Desktop/docker-v/kibana
docker cp kibana:/usr/share/kibana/data /Users/lizihan/Desktop/docker-v/kibana
1 | docker cp es8:/usr/share/elasticsearch/config/certs/http_ca.crt /Users/lizihan/Desktop/docker-v/elasticsearch |
1 | docker pull qbanxiaoli/fastdfs |
1 | docker run -d --restart=always --name=fastdfs -p 22122:22122 -p 81:81 -p 11411:11411 -p 11411:11411/udp -p 12200:12200 -p 12200:12200/udp -p 8080:8080 -e IP=192.168.50.99 -e WEB_PORT=81 -v /Users/lizihan/Desktop/docker-v/fastdfs:/var/local qbanxiaoli/fastdfs |
1 | echo "Hello FastDFS!">index.html |
1 | docker inspect -f='{{.Name}} {{.NetworkSettings.IPAddress}} {{.HostConfig.PortBindings}}' $(docker ps -aq) |
/tracker 172.17.0.5 map[22122/tcp:[{ 22122}]]
/usr/local/nginx/conf/nginx.conf
/etc/fdfs/storage.conf
ps: mac win使用git官网的components linux使用一键安装
1 | docker pull redis:latest |
1 | docker run -p 6379:6379 --name redis \ |
1 | docker run -p 6379:6379 --name redis \ |
1 | docker run -p 6379:6379 --name redis \ |
1 | #bind 127.0.0.1 |
1 | docker pull jenkins/jenkins:latest |
1 | docker run -d -u root -p 你的端口:8080 \ |
1 | sudo vim /home/ubuntu/docker-v/toolJenkins/jenkinsHome/hudson.model.UpdateCenter.xml |
1 | sudo vim /home/ubuntu/docker-v/toolJenkins/jenkinsHome/updates/default.json |
1 | docker pull nginx:latest |
1 | docker run --name service-nginx -p 8084:80 -d nginx |
p映射端口
d后台运行
v挂在目录,可以根据需求自行设置
1 | 1. vim /home/jmlib/docker-v/serviceNginx/nginx.conf |
1 | user nginx; |
1 | docker run -d \ |
1 | docker run -d \ |
1 | server{ |
1 | server{ |
1 | sudo apt-get remove docker docker-engine docker.io |
1 | sudo apt-get update |
1 | sudo apt-get install \ |
1 | curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - |
如出现:gpg: can’t connect to the agent: IPC connect call failed 这种问题,可以尝试:
1.sudo apt remove gpg
2.sudo apt install gnupg1
3.在执行 curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
1 | sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" |
1 | sudo apt-get install docker-ce docker-ce-cli containerd.io |
docker ps -a 出现
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1: dial unix /var/run/docker.sock: connect: permission denied
sudo groupadd docker
1 | sudo groupadd docker #添加docker用户组 |
docker pull mysql:8.0
1 | mkdir /home/jmlib/docker-v/mysql8/data |
1 | vim /home/jmlib/docker-v/mysql8/data/my.cnf |
1 | vim /home/jmlib/docker-v/mysql8/data/my.cnf |
1 | [client] |
1 | docker run -d -p 3306:3306 \ |
1 | docker run -d -p 3306:3306 \ |
1 | docker exec -it mysql bash |