容器内已装载的空间为空 [英] Mounted volume is empty inside container

查看:65
本文介绍了容器内已装载的空间为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 docker-compose.yml 像这样:

db:
  image: mongo:latest
  ports:
    - "27017:27017"
server:
  image: artificial/docker-sails:stable-pm2
  command: sails lift
  volumes:
    - server/:/server
  ports:
    - "1337:1337"
  links:
    - db

server / 是相对于 docker-compose.yml 文件的文件夹。但是,当我 docker exec -it CONTAINERID / bin / bash 并检查 / server 时,它为空。

server/ is relative to the folder of the docker-compose.yml file. However when I docker exec -it CONTAINERID /bin/bash and check /server it is empty.

我在做什么错了?

推荐答案

尝试使用:

volumes:
  - ./server:/server

而不是 server / -在某些情况下,Docker不喜欢结尾的斜杠。

instead of server/ -- there are some cases where Docker doesn't like the trailing slash.

这篇关于容器内已装载的空间为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆