Docker错误:无法创建服务容器,没有此类文件或目录

时间:2018-08-13 07:29:42

标签: docker docker-compose ckan

我正在尝试通过docker-compose安装CKAN: http://docs.ckan.org/en/2.8/maintaining/installing/install-from-docker-compose.html

如果我尝试使用:

docker-compose up -d --build

我不断得到:

ERROR: for db  Cannot create container for service db: no such file or directory
ERROR: compose.cli.main.main: Encountered errors while bringing up the project.

使用详细标志,我得到:

compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- (u'docker_db')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/images/docker_db/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'Open Knowledge',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'postgres'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
...
compose.service.build_container_labels: Added config hash: dfb16feda9d1de6f3a84b0a6e1ecee1a8d041d06d5676351f8f723b05c4f6f03
compose.cli.verbose_proxy.proxy_callable: docker create_host_config <- (device_read_iops=None, mem_swappiness=None, links=[], oom_score_adj=None, blkio_weight=None, cpu_count=None, cpuset_cpus=None, dns_search=None, pid_mode=None, init_path=None, log_config={'Type': u'', 'Config': {}}, cpu_quota=None, read_only=None, cpu_percent=None, device_read_bps=None, storage_opt=None, init=None, dns=None, volumes_from=[], ipc_mode=None, mem_reservation=None, security_opt=None, shm_size=None, device_write_iops=None, dns_opt=None, cgroup_parent=None, group_add=None, network_mode=u'docker_default', volume_driver=None, oom_kill_disable=None, userns_mode=None, tmpfs=[], nano_cpus=None, port_bindings={}, isolation=None, memswap_limit=None, restart_policy=None, blkio_weight_device=None, devices=None, extra_hosts=None, binds=[u'docker_pg_data:/var/lib/postgresql/data:rw'], sysctls=None, pids_limit=None, device_write_bps=None, cap_add=None, mounts=None, mem_limit=None, runtime=None, cap_drop=None, privileged=False, ulimits=None, cpu_shares=None)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config -> {'Binds': [u'docker_pg_data:/var/lib/postgresql/data:rw'],
 'Links': [],
 'LogConfig': {'Config': {}, 'Type': u''},
 'NetworkMode': u'docker_default',
 'PortBindings': {},
 'VolumesFrom': []}
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (name='db', image=u'docker_db', labels={u'com.docker.compose.service': u'db', u'com.docker.compose.project': u'docker', u'com.docker.compose.config-hash': 'dfb16feda9d1de6f3a84b0a6e1ecee1a8d041d06d5676351f8f723b05c4f6f03', u'com.docker.compose.version': u'1.19.0', u'com.docker.compose.oneoff': u'False', u'com.docker.compose.container-number': '1'}, host_config={'NetworkMode': u'docker_default', 'Links': [], 'PortBindings': {}, 'Binds': [u'docker_pg_data:/var/lib/postgresql/data:rw'], 'LogConfig': {'Type': u'', 'Config': {}}, 'VolumesFrom': []}, environment=[u'POSTGRES_PASSWORD=uuimwc', u'DS_RO_PASS=uuimwc'], volumes={u'/var/lib/postgresql/data': {}}, detach=True, networking_config={u'EndpointsConfig': {u'docker_default': {u'IPAMConfig': {}, u'Aliases': ['db']}}})
compose.parallel.feed_queue: Pending: set([<Service: ckan>])
compose.parallel.feed_queue: Pending: set([])
Creating db ... error
compose.parallel.feed_queue: Pending: set([])
compose.parallel.feed_queue: Pending: set([])
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.25/containers/create?name=db HTTP/1.1" 500 40
compose.parallel.parallel_execute_iter: Failed: ServiceName(project=u'docker', service='db', number=1)
compose.parallel.feed_queue: Pending: set([])

ERROR: for db  Cannot create container for service db: no such file or directory
compose.parallel.parallel_execute_iter: Failed: <Service: db>
compose.parallel.feed_queue: Pending: set([<Service: ckan>])
compose.parallel.feed_queue: <Service: ckan> has upstream errors - not processing
compose.parallel.parallel_execute_iter: Failed: <Service: ckan>

谁能告诉我如何找出造成这种情况的原因? 这些错误似乎并没有真正的意义,如何找到丢失的文件或目录?

4 个答案:

答案 0 :(得分:3)

尝试:

docker system prune

groupBy

从/ var / lib / docker / volumes / [MY-VOLUME]删除卷后对我有用

答案 1 :(得分:1)

手动删除目录时遇到相同的问题

  

rm -fr / var / lib / docker / volumes / [您的卷]

对我来说,解决方案是删除docker中的卷 首先列出现有卷

  

docker volume ls

找到您要删除的那个 然后

  

docker volume rm [your_volume]

那我能够做docker-compose

答案 2 :(得分:0)

重新安装docker和docker-compose解决了所有问题。

答案 3 :(得分:0)

enter image description here

在文件共享资源中添加工作项目。