- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
了解了docker(在Ubuntu 18.04 LTE(仿生)上),特别是关于管理持久数据的知识,我发现docker volumes。
按照那里的示例,我尝试将一些文件添加到卷中,然后从容器中列出它们:
root@srv /v/l/machines# docker volume create hello
hello
root@srv /v/l/machines# docker run -d -v hello:/world busybox ls /world
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
57c14dd66db0: Pull complete
Digest: sha256:7964ad52e396a6e045c39b5a44438424ac52e12e4d5a25d94895f2058cb863a0
Status: Downloaded newer image for busybox:latest
d488dd535de01209ccc4f4bbf9a269d7932868ca41c9fe538d7a95fad66cefae
ls
输出为空。还行吧。
root@srv /v/l/machines# docker volume inspect hello
[
{
"CreatedAt": "2019-01-14T14:57:47+01:00",
"Driver": "local",
"Labels": {},
"Mountpoint": "/var/lib/docker/volumes/hello/_data",
"Name": "hello",
"Options": {},
"Scope": "local"
}
]
root@srv /v/l/machines# date > /var/lib/docker/volumes/hello/_data/a.txt
root@srv /v/l/machines# date > /var/lib/docker/volumes/hello/_data/b.txt
root@srv /v/l/machines# docker run -d -v hello:/world busybox ls /world
ced5591203511f2f9a0194431ba8fca81df8442c38be993de454cadb1b93da09
root@srv /v/l/machines# docker run -d -v hello:/world busybox ls /world
7987ce187747016e81469cb1a150aa0a85ded58521fbc03f1a0f55e2e07358f0
root@srv /v/l/machines# ls /var/lib/docker/volumes/hello/_data/
a.txt b.txt
docker volume inspect
指出的地方添加了一些文件,但在装载该卷的Docker容器中,它们似乎不可见。为什么会这样呢?
最佳答案
您的容器以分离模式运行,这就是为什么您看不到任何输出的原因。
尝试运行docker logs <container-id>
,它应该显示ls
-command的结果。
另外,您可以省略-d
标志以在前台运行容器。这在您只想尝试的情况下特别有用。
文档:docker run – detached vs foreground
关于docker - 为什么从docker容器中看不到/var/lib/docker/volumes/<volume>/_ data/中的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54183196/
docker volume 命令中使用的两个标志之间的确切区别是什么 -v和 --volumes-from .在我看来,他们正在做同样的工作,请考虑以下场景。 首先让我们创建一个名为 myvol 的卷
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
我正在尝试创建一个 docker 容器,该容器具有一个应包含多个文件夹的外部卷,因此我的 Dockerfile 简化版本如下所示: FROM ubuntu:12.04 # Create a volum
我正在使用打开 Kubernetes 选项的 docker 应用程序运行 mac OSX Catalina。我使用以下 yaml 和命令创建了一个 PersistentVolume。 apiVersi
我看到了 docker-compose 模式,但我很困惑。制作组合容器的最佳方法是什么。什么时候应该使用 link 或 volumes_from。我什么时候应该使用 volumes_from, vol
我对创建 docker volume create my-vol 之间的区别感到困惑。和 VOLUME ["/var/www"] . 我的理解是: 1) docker volume create my
要在 Kubernetes POD 中使用存储,我可以使用 volumes和 persistent volumes .而卷像emptyDir是短暂的,我可以使用 hostPath以及许多其他基于云的卷
使用 btrfs 驱动程序在 RHEL 7.1 上运行 docker v1.10.1。我有一个单独的 xfs 分区,我想在其中挂载数据卷。我宁愿让 docker 本地管理卷(即使用 docker vo
我想在我的 docker-compose 文件中设置一个标志,如果我不需要我的数据库卷是否不会在容器外持久化,但我仍然想要一个卷条目,如果我的数据库很小那么我不希望它执着于外。 最佳答案 您可以使用两
我是 Kubernetes 的新手,我很难理解 Kubernetes 中持久存储背后的整个想法。 这就足够了吗,或者我必须创建持久卷,如果我只部署这两个对象而不创建 PV 会发生什么情况? 存储应该在
我正在研究 kubeflow 管道以及管道的不同组件如何相互链接。为此,我使用了官方 GitHub 存储库中提供的 MNIST 项目示例。但我无法理解以下代码片段中 vop.volume 和 mnis
我正在尝试设置 Dockerfile将我的主机目录挂载到我指定的 docker 容器目录(因此代码更改将立即反射(reflect)出来)。当我运行 docker run -p 3000:3000 -d
我有一个使用 docker-compose 在 Ubuntu 服务器上运行的 Jira 实例。 我最初通过将 jira 安装文件夹映射到名为 jiravolume 的 docker 卷来设置它。 vo
如何检测在 iOS/Android 上是否按下了 + 或 - 按钮? 最佳答案 我认为它对 iOS 有帮助.. - (void)viewWillAppear:(BOOL)animated {
我是 Docker 的新手。我在 Windows 10 企业版 上运行,并尝试将在 Windows 上运行的现有应用容器化(因此它是一个 Windows 容器)。我不知道这是否重要,但容器相当大 (8
我已经断断续续地搜索文档、邮件列表几天了,但似乎找不到答案。 我有一个 OS X 应用程序,除其他外,它可以使用 kAudioDevicePropertyVolumeScalar 等查询可用的硬件设备
了解了docker(在Ubuntu 18.04 LTE(仿生)上),特别是关于管理持久数据的知识,我发现docker volumes。 按照那里的示例,我尝试将一些文件添加到卷中,然后从容器中列出它们
在这段代码中,如果Volume>10mil,我开始将体积添加到Cumulative Volume,我们在蜡烛下面创建一条线,一直延伸到当前条,因此Volume>10mil,我们创建一条线,Cumvol
这个问题在这里已经有了答案: Kubernetes NFS Persistent Volumes - multiple claims on same volume? Claim stuck in p
使用 docker-compose synthax v2,我们能够做这样的事情: version: '2' services: app: image: tianon/true vo
我是一名优秀的程序员,十分优秀!