https://store.docker.com/editions/community/docker-ce-desktop-mac
sudo pip install docker-compose
创建软连接
ln -s /Volumes/xxxx com.docker.docker
docker run -d -v "/var/run/docker.sock:/var/run/docker.sock" -p 9000:9000 portainer/portainer
执行完后,浏览器打开localhost:9000
docker build -t tradebot .
docker run -d --name bot tradebot -p 19876:9876 # running at http:localhost:9876
docker ps # 查看运行状态
docker images // list the images and their respective ids
docker ps // list the containers and their respective ids
docker stop my_container // to stop the container
docker rmi <image_id> // to remove the image
docker rm <container_id> // to remove the container
sudo docker run --detach \
--hostname git.marstau.com \
--publish 443:443 --publish 88:80 --publish 2222:22 \
--name gitlab \
--restart always \
--volume /Volumes/e/system/gitlab/config:/etc/gitlab \
--volume /Volumes/e/system/gitlab/logs:/var/log/gitlab \
--volume /Volumes/e/system/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:11.2.3-ce.0
sudo docker run --detach \
--hostname git.marstau.com \
--publish 443:443 --publish 88:80 --publish 2222:22 \
--name gitlab \
--restart always \
--volume ~/softwares/docker/gitlab/config:/etc/gitlab \
--volume ~/softwares/docker/gitlab/logs:/var/log/gitlab \
--volume ~/softwares/docker/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:11.4.0-ce.0
# 进入bash
sudo docker exec -it gitlab /bin/bash
# 查看容器ip地址
docker inspect --format='' gitlab
no matching manifest for linux/arm64/v8 in the manifest list entries
Error response from daemon: Get https://registry-1.docker.io/v2/karalabe/xgo-latest/manifests/latest: unauthorized: incorrect username or password
Solution:
docker login
若gitlab启动不了,则docker restart gitlab
在启动瞬间执行
docker exec -t gitlab gitlab-ctl reconfigure
==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
ArgumentError: Already running on PID:818 (or pid=/opt/gitlab/var/unicorn/unicorn.pid is stale)
/opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:195:in `pid='
/opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:127:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
/opt/gitlab/embedded/bin/unicorn:23:in `load'
/opt/gitlab/embedded/bin/unicorn:23:in `<top (required)>'
Solution:
docker exec -it gitlab rm /opt/gitlab/var/unicorn/unicorn.pid && docker restart gitlab
Error response from daemon: chown /var/lib/docker/containers/620906516f3aa3e126fea6e45d7b9403c3f188f35c1ed2e2230d490a24676fd7/resolv.conf: read-only file system
restart docker
Solution:
copy docker run然后手动执行这条命令 并修改其中端口号即可