我知道 Snappy Ubuntu 可以托管 Docker 容器。我的问题是它是否也可以作为 Docker 来宾在容器内运行。
我问的原因是我在公共 Docker 存储库中找不到任何 Snappy VM 来宾容器。
我遇到了一个奇怪的情况,我可以在某些主机上进行 DNS 查找,而在其他主机上则不能。这似乎与 resolv.conf 有一个指向我的名称服务器的名称服务器条目和另一个可能与 docker 相关的条目有关,但我不确定如何修复它。
我一直在阅读Stéphane Graber 对 LXD 的精彩介绍,并想尝试一下。因此,我做了:
$ sudo usermod -a -G lxd <myusername>
$ newgrp lxd
$ sudo lxd init
Run Code Online (Sandbox Code Playgroud)
我使用所有默认设置对其进行了配置。然后我输入:
$ lxc image list images:
error: Get https://images.linuxcontainers.org/streams/v1/index.json: lookup images.linuxcontainers.org: no such host
Run Code Online (Sandbox Code Playgroud)
我尝试从另一台 PC 上的 Web 浏览器访问该地址,并且运行良好。所以我认为 DNS 设置一定有问题,但是:
$ host images.linuxcontainers.org
images.linuxcontainers.org is an alias for canonical.images.linuxcontainers.org.
canonical.images.linuxcontainers.org has address 91.189.91.21
canonical.images.linuxcontainers.org has address 91.189.88.37
canonical.images.linuxcontainers.org has IPv6 address 2001:67c:1560:8001::21
canonical.images.linuxcontainers.org has IPv6 address 2001:67c:1562::41 …Run Code Online (Sandbox Code Playgroud) 实际上,我不确定这是否可以完成,但我知道总有一个 hack ,所以我对你们专家对此的看法充满热情。
我想在构建我的 docker 镜像时传递一个包作为参数,以便我可以使用相同的 dockerfile 部署不同的应用程序版本。
这是我想要实现的示例:
在构建图像时将包作为参数传递的能力(我知道语法是错误的,这只是一个示例)
docker build -t myapp/myapp:v1 . package_myapp_v1.tar
Run Code Online (Sandbox Code Playgroud)
然后使用ADDin 将Dockerfile其提取到容器中。
ADD passed_package ./
Run Code Online (Sandbox Code Playgroud)
因此,如果我想为我的应用程序的 v2 构建一个映像,我只需在docker build命令中指定新包,而无需更改Dockerfile.
任何人都知道让它工作的技巧是什么?
谢谢 :)
我正在尝试在 Ubuntu 16.04 上安装 docker。我是一个完整的 Ubuntu 新手,最近才安装它。
下面是安装步骤:https : //docs.docker.com/engine/installation/linux/ubuntu/
为了设置目录,我必须运行以下命令:
bash $ sudo apt-get -y --no-install-recommends install \ curl \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
Run Code Online (Sandbox Code Playgroud)
我很困惑到底要复制和粘贴什么。我首先从 sudo 复制并粘贴了所有内容:
sudo apt-get -y --no-install-recommends install \ curl \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
E: Unable to locate package curl
E: Unable to locate package apt-transport-https
E: Unable to locate package ca-certificates
E: Unable to locate package curl
E: Unable to locate package software-properties-common
Run Code Online (Sandbox Code Playgroud)
你知道那些错误是什么意思吗,我该怎么做才能正确安装 Docker? …
我尝试docker-ce按照官方 Docker 文档中提供的说明使用存储库进行安装。安装在这一点上卡住了:
Setting up docker-ce (17.09.0~ce-0~ubuntu) ...
insserv: warning: script 'K01postgresql-9.5' missing LSB tags and overrides
insserv: warning: script 'postgresql-9.5' missing LSB tags and overrides
Run Code Online (Sandbox Code Playgroud)
等待了很长时间后,我用sudo killall apt-get. 现在,每当我尝试使用使用 apt-get 的命令时,它都会显示以下内容:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
Run Code Online (Sandbox Code Playgroud)
当我运行该命令时,它只是开始运行从未完成的原始命令。此时,我只想解决这个问题,甚至无法运行 Docker(我只是想尝试一下)。
我已经尝试了这个相关问题的大多数答案。我什sudo apt-get remove docker-ce至无法使用,因为我遇到了同样的问题。
关于 docker 安装的一些信息:
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e …Run Code Online (Sandbox Code Playgroud) 我从一本书中向 docker 自我介绍,我按照一个简单的说明制作了 Dockerfile 并按如下方式运行构建命令:
Dockerfile 内容:
FROM busybox:latest
CMD echo Hello World!
Run Code Online (Sandbox Code Playgroud)
然后我跑了:
sudo docker build .
Run Code Online (Sandbox Code Playgroud)
在 Dockerfile 所在的文件夹中。我的问题是,“将构建上下文发送到 Docker 守护程序”中的 10.62GB 到底是什么?构建这个镜像需要大约 7 到 8 分钟的时间,而这个数字攀升到 10.62GB。这是正常的吗?我想,这是否代表图像大小,因为我认为容器图像相对较小?
谢谢。
我注意到许多基于 Debian/ubuntu 的 docker 镜像,你必须apt-get update在安装任何软件包之前做一个。缓存是完全清楚的。我觉得我在做完我的RUN apt-update && apt-get install -y whatever. 我不知道该怎么做。是否有命令,或者我只是rm -rfq 文件夹?
场景:我正在尝试在基于 Ubuntu 18.04 docker 映像的 docker 容器上设置时区。只需拉取映像、更新并安装 systemd
> apt-get -y update
> apt-get -y install systemd
Run Code Online (Sandbox Code Playgroud)
错误: 无法创建总线连接:没有这样的文件或目录
> timedatectl
> timedatectl: Failed to create bus connection: No such file or directory
Run Code Online (Sandbox Code Playgroud)
问题:我缺少什么?
注意: etc目录下没有localtime和timezone文件
> ls /etc/localtime
> ls: cannot access '/etc/localtime': No such file or directory
> ls /etc/timezone
> ls: cannot access '/etc/timezone': No such file or directory
Run Code Online (Sandbox Code Playgroud)
我已经看到了这个和这个但没有解决,因为在我的情况下没有缺少 dbus
> apt-get install dbus
> dbus is already the newest …Run Code Online (Sandbox Code Playgroud) 我想运行一个 docker 容器,它将能够systemctl在其主机上运行命令。
在这个问题之后,我没有找到适合我的解决方案。
我对 docker 基本映像没有硬性限制,因此对 ubuntu-16.04 主机使用 ubuntu-16.04 docker 映像,对 ubuntu-18.04 主机使用 ubuntu-18.04 docker 映像是完全可以接受的。
我的 Ubuntu 20.04 安装了 docker-compose 版本 1.25.0,而最新版本是 2.0.1(这是为什么?)。
有没有办法强制Ubuntu安装最新版本?
如果没有,那么我必须遵循官方说明,但该curl命令指向/usr/local/bin安装在我的计算机上的目录/usr/bin。
那么升级我的套餐的安全方法是什么?
docker ×10
apt ×3
systemd ×2
16.04 ×1
16.10 ×1
18.04 ×1
command-line ×1
container ×1
dbus ×1
dns ×1
dpkg ×1
lxc ×1
networking ×1
repository ×1
timezone ×1
ubuntu-core ×1