1.win7、win8 等需要利用 docker toolbox 来安装,从https://docs.docker.com/toolbox/toolbox_install_windows/下载安装。
现在 Docker 有专门的 Win10 专业版系统的安装包,需要开启Hyper-V。
2.make build命令在windows下无法运行https://docs.sentry.io/server/installation/docker/
docker build . //.表示Dockerfile 文件所在目录,可以指定Dockerfile 的绝对路径或url
docker build https://github.com/docker/rootfs.git#container:docker
参考:https://docs.docker.com/engine/reference/commandline/build/#specify-a-dockerfile--f
3.power shell 换行符和复制粘贴
linux:
docker run
--detach
--name sentry-redis
redis:3.2-alpine
window:
docker run --detach
--name sentry-redis `
redis:3.2-alpine
复制粘贴:
右键选择标记,选中再右键取消,然后再右键选择粘贴
4.git bash 远程登录docker machine
因为Docker Quickstart Terminal不能复制粘贴不方便,而power shell 有些命令和linux下有差别。所以用git bash远程登录docker machine。
上图有docker 虚拟机的地址 192.168.99.100,默认用户名/密码: docker/tcuser
打开git,输入ssh docker@192.168.99.100
然后输入密码 tcuser
5.docker run
--rm {REPOSITORY} \ config generate-secret-key 一直报错Unable to find image 'config:latest' locally stackoverflow docker-compose run \ --rm{REPOSITORY}
config generate-secret-key
一直报错ERROR: No such service: config或者报下面的错误
docker-compose ERROR: for postgres Cannot create container for service postgres: b"invali D:\Docker Toolbox\onpremise\data\postgres:/var/lib/postgresql/data:rw'"
docker run --rm sentry config generate-secret-key就没有问题,
生成key :
c-))g-4g0=h-t96lu82l7rro++#fif9m^df)i+6@ye#ulksu
然后修改docker-compose.yml 文件中的SENTRY_SECRET_KEY为 'c-))g-4g0=h-t96lu82l7rro++#fif9m^df)i+6@ye#ulksu'
再运行docker run -it --rm -e SENTRY_SECRET_KEY='c-))g-4g0=h-t96lu82l7rro++#fif9m^df)i+6@ye#ulksu' --link sentry-smtp:smtp --link sentry-postgres:postgres --link sentry-redis:redis sentry upgrade
5.运行Sentry server服务
docker run -d --name sentry-cron -e SENTRY_SECRET_KEY='c-))g-4g0=h-t96lu82l7rro++#fif9m^df)i+6@ye#ulksu' --link sentry-smtp:smtp --link sentry-postgres:postgres --link sentry-redis:redis sentry run cron
docker run -d --name sentry-worker-1 -e SENTRY_SECRET_KEY='c-))g-4g0=h-t96lu82l7rro++#fif9m^df)i+6@ye#ulksu' --link sentry-smtp:smtp --link sentry-postgres:postgres --link sentry-redis:redis sentry run worker
docker run -d --name sentry-web -p 8080:9000 -e SENTRY_SECRET_KEY='c-))g-4g0=h-t96lu82l7rro++#fif9m^df)i+6@ye#ulksu' --link sentry-smtp:smtp --link sentry-postgres:postgres --link sentry-redis:redis sentry run web
在浏览器打开http://192.168.99.100:8080,注意不是本机地址
6.linux docker build . 报错
/usr/bin/docker-current: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
After the installation finishes, Docker usually starts up on its own, but for the next part to work you will need to stop it.
sudo service docker stop
Then run the daemon with the following command:
sudo nohup docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock &
The script leaves the daemon running in the background, and with the Docker ready you can test that it is accepting commands.
sudo docker info
To make working with Docker easier, you should add your username to the Docker users group. Adding a user to the group can be done with the command underneath by replacing the <username> with your username.
sudo usermod -aG docker <username>
Afterward, sign out of the server and then back in again to have the group policy changes take effect. By doing so, you can use Docker commands without needing to invoke sudo.
参考:https://www.upcloud.com/support/how-to-configure-docker-swarm/
7.shim error: docker-runc not installed on system
ln -s /usr/libexec/docker/docker-runc-current /usr/bin/docker-runc
建立软连接,链接必须放在/usr/bin文件夹下面
8.exec: "docker-proxy": executable file not found in $PATH.
ln -s /usr/libexec/docker/docker-proxy-current /usr/bin/docker-proxy
参考:http://www.cnblogs.com/xiashiwendao/p/7859815.html
9./usr/bin/docker-current: Error response from daemon: Conflict. The container name "/sentry-web" is already in use by container 3cecc20f63c4dd44035faa6a0de07a7cd13faa9a34ea9c6f16497cb5fb689a2e.
docker rm sentry-web
- Bind for 0.0.0.0:8080 failed: port is already allocated.
换个端口docker run -d --name sentry-web -p 8081:9000
11.docker-machine command not found centos
If you are running on Linux:
base=https://github.com/docker/machine/releases/download/v0.14.0 && curl -Lbase/docker-machine-(uname -s)-(uname -m) >/tmp/docker-machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine
参考:https://docs.docker.com/machine/install-machine/#install-machine-directly
12.Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
systemctl start docker
参考:https://stackoverflow.com/questions/44678725/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker