我正在按照官方指南安装 Docker。
在第 2 步添加 Docker 的官方 GPG 密钥时,出现以下错误:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
gpg: invalid key resource URL '/tmp/apt-key-gpghome.Rcg4Lpatvi/home:manuelschneid3r.asc.gpg'
gpg: keyblock resource '(null)': General error
gpg: key 1488EB46E192A257: 1 signature not checked due to a missing key
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key 871920D1991BC93C: 1 signature not checked due to a missing key
gpg: Total …Run Code Online (Sandbox Code Playgroud) 我正在尝试构建 Raspberry Pi docker 映像,但我总是遇到相同的错误,类似于this one、this one和this one。
apt update在 a arm32v7/ubuntu:20.04(或仅ubuntu:latest)中以 root 身份运行命令时,我得到以下输出:
root@273d63597ce6:/# apt update
Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [111 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [98.3 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
At least one invalid signature was encountered.
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
At least one …Run Code Online (Sandbox Code Playgroud) docker-desktop我正在尝试从这里安装。我下载的.deb包是:
sudo dpkg -i docker-desktop-4.8.1-amd64.deb
Run Code Online (Sandbox Code Playgroud)
但我遇到了一些缺少依赖项的问题:
(Reading database ... 422535 files and directories currently installed.)
Preparing to unpack docker-desktop-4.8.1-amd64.deb ...
Unpacking docker-desktop (4.8.1-78998) over (4.8.1-78998) ...
dpkg: dependency problems prevent configuration of docker-desktop:
docker-desktop depends on docker-ce-cli; however:
Package docker-ce-cli is not installed.
docker-desktop depends on pass; however:
Package pass is not installed.
dpkg: error processing package docker-desktop (--install):
dependency problems - leaving unconfigured
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) …Run Code Online (Sandbox Code Playgroud) 我使用 Docker 安装了一个 Ubuntu Trusty 容器,当我连接到它时,我可以看到语言环境设置为最低限度:
sudo docker run -i -t <id> /bin/bash
root@<id>:/# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
Run Code Online (Sandbox Code Playgroud)
我需要使用Unicode语言环境(例如美国英语语言环境en_US.UTF-8)。
我尝试编辑 /etc/default/locale 文件并将其放入:
# cat /etc/default/locale
LANG=en_US.UTF-8
Run Code Online (Sandbox Code Playgroud)
但是即使在离开容器并返回之后,区域设置仍然没有正确设置。
我也尝试使用该update-locale命令,但没有成功:
root@cab13a6abe4f:/# update-locale LANG=en_US.UTF-8
root@cab13a6abe4f:/# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
Run Code Online (Sandbox Code Playgroud)
在我的本地配置中,我有以下配置:
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8 …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 ubuntu 15.04 中了解“Docker”。
当我使用诸如“docker run image”之类的 docker 发出任何命令时,它会收到以下错误:
FATA[0000] Post http:///var/run/docker.sock/v1.17/containers/create: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
Run Code Online (Sandbox Code Playgroud)
我不明白这是什么意思。
我已经安装了 Ubuntu 17.04 (VirtualBox)。但是因为我有 Ubuntu 17.04,所以 docker 似乎不适用于 Ubuntu 17.04。是否有任何解决方法可以在 Ubuntu 17.04 上安装 Docker?
这是我的命令行历史记录:
2 curl -L https://github.com/docker/machine/releases/download/v0.10.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
3 docker-machine version
4 docker pull ubuntu:latest
5 sudo apt-get update
6 sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
7 sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
8 sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
9 sudo apt-key fingerprint 0EBFCD88
10 lsb_release -cs
11 sudo add-apt-repository "deb [arch=amd64] …Run Code Online (Sandbox Code Playgroud) 面对
E: Package 'libmysqlclient-dev' has no installation candidate
Run Code Online (Sandbox Code Playgroud)
我正在使用此博客作为参考:https : //rehalcon.blogspot.com/2018/03/dockerize-your-django-app-for-local.html
这是我的 docker 文件:
FROM python:2-slim
LABEL org.label-schema.name='app-dj'
RUN apt-get clean && \
apt-get update && \
apt-get install -y \
curl \
vim \
tmux \
build-essential \
libjpeg-dev \
libpq-dev \
python-dev \
libmysqlclient-dev && \
pip install -U pip 3to2
COPY requirements.txt req.txt
RUN pip install -r /req.txt
RUN mkdir -p /app
WORKDIR /app
EXPOSE 8069
CMD python /app/server.py
Run Code Online (Sandbox Code Playgroud) 我阅读了 的文档wget但不明白如何下载包。是否有任何方法(命令)在 Docker 容器内使用 Ubuntu 上的终端下载包?
在我的笔记本电脑中,我主要使用 LXD 来开发容器并管理生产中的 LXD 容器(与 Ansible 集成)。
我有一个docker/docker-compose用于部署的要求。我知道我可以安装docker.io包(具有 LXC 兼容性的补丁)但是现在,Docker 提倡使用 Docker-CE/Docker-EE。在这种情况下将是 Docker-CE。
这个有docker.ioUbuntu 软件包中的补丁吗?或者将来可以从 Canonical 存储库或 PPA 部署 Docker-CE 引擎?
thufir@dur:~$ sudo snap install docker
docker 17.06.1-ce from 'docker-inc' installed
thufir@dur:~$ sudo service docker start
Failed to start docker.service: Unit docker.service not found.
thufir@dur:~$ sudo systemctl status docker
Unit docker.service could not be found.
thufir@dur:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful
thufir@dur:~$ snap list
Name Version Rev Developer Notes
core 16-2.29.3 3440 canonical core
docker 17.06.1-ce 171 docker-inc -
hello-world 6.3 27 canonical - …Run Code Online (Sandbox Code Playgroud)