提供标记但未在运行docker容器时定义-d

时间:2016-12-28 18:21:34

标签: docker

我正在尝试使用docker在我的本地电脑上设置此https://github.com/jwasham/computer-science-flash-cards但是在我构建了我的图像后,当我尝试

docker run -d -p 8000:8000 --name cs-flash-cards cs-flash-cards

它说

flag provided but not defined: -d

如何修复此问题并运行此容器?

编辑(在码头信息;码头版本我得到以下信息):

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 10
Server Version: 1.12.5
Storage Driver: devicemapper
 Pool Name: docker-202:1-312980-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 877.5 MB
 Data Space Total: 107.4 GB
 Data Space Available: 2.019 GB
 Metadata Space Used: 1.913 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.019 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.110 (2015-10-30)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-45-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 990.7 MiB
Name: ip-172-31-33-253
ID: QPUK:E7BB:Y2PW:MPJR:L2X4:4AMT:VHAT:SOXK:3A2N:UKI2:ZXRK:QF4S
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8
Client:
 Version:      1.12.5
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   7392c3b
 Built:        Fri Dec 16 02:42:17 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.5
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   7392c3b
 Built:        Fri Dec 16 02:42:17 2016
 OS/Arch:      linux/amd64

1 个答案:

答案 0 :(得分:0)

只为下一个遇到同样问题的人。

这是针对Ubuntu LTS上的SystemD和docker.service文件 是修复。

如果您使用的是Centos7,则可能会有一个名为override.conf的额外文件 这用于覆盖systemd中的docker.service。 该文件还具有-d标志 并位于 /etc/systemd/system/docker.service.d/override.conf

在这里替换-d与deamon 做systemctl daemon-reload和docker会启动。