Docker:Windows10 Home 上使用Docker遇到的一些问题

目录

问题一、docker.exe: Error response from daemon: invalid mode: \Program Files\Git\var\jenkins_home

问题二、Windows 10中docker image的存放路径

问题三、docker中的应用无法被外网访问


开发环境:

Windows 10 Home
Docker Toolbox

问题一、docker.exe: Error response from daemon: invalid mode: \Program Files\Git\var\jenkins_home

$ ./docker run  -u root --rm  -d  -p 8080:8080  -p 50000:50000 -v /var/jenkins-data:/var/jenkins_home jenkinsci/blueocean
C:\Docker Toolbox\docker.exe: Error response from daemon: invalid mode: \Program Files\Git\var\jenkins_home.

将文件路径前的/改成//

$ ./docker run  -u root --rm  -d  -p 8080:8080  -p 50000:50000 -v //var/jenkins-data://var/jenkins_home --name jenkins-blueocean jenkinsci/blueocean

另外一种方式就是设置将docker安装路径设置到PATH中,这样使用/就行。

需要说明的是路径/var/jenkins-data是virtualBox虚拟机上的路径,不是windows10上的路径。
 

问题二、Windows 10中docker image的存放路径

$ ./docker info
Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 1
Server Version: 18.09.5
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.14.111-boot2docker
Operating System: Boot2Docker 18.09.5 (TCL 8.2.1)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 989.4MiB
Name: default
ID: O7UQ:EK7F:7KRS:HI6Z:LCMR:BVMZ:L255:I4FP:YCKI:2OCS:JQ73:RGHF
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
No Proxy: 192.168.99.100
Username: netyeaxi
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

 Docker Root Dir对应的路径就是images存放的路径。同样,此路径也是virtualBox虚拟机上的路径。

 

问题三、docker中的应用无法被外网访问

使用Docker Toolbox时,会在VirtualBox中生成一个默认的虚拟机Default
需要在VirtualBox -> Default -> 网络 中设置端口转发

 

参考文档

Docker Toolbox: Error response from daemon: invalid mode: /root/docker

你可能感兴趣的:(Docker)