我正在使用docker-machine,并使用VirtualBox驱动程序创建了一个VM。我想暂停我的机器,而不杀死该机器上所有正在运行的docker dontainers。这有可能吗?我想恢复我的机器,并恢复我所有正在运行的容器。
我正在使用最新的Docker工具包在OSX上使用Docker在本地开发.我有一个在docker容器中运行的节点服务器,绑定到VM的端口9999.我可以从我的Mac上的浏览器中点击这个服务器,我想从同一网络上的另一台设备上攻击.有没有办法将VM绑定到机器的IP地址?或以其他方式揭露它?
背景
有一个我无法控制的私有 docker 注册表。无法从我的计算机访问此注册表,但可以从我有权访问的远程服务器访问。
这是我当前(效率很低)的工作流程:
# On my machine
$ docker save IMAGE > FILE
$ scp FILE SERVER
$ ssh SERVER
# On the server
$ docker load < FILE
$ docker tag -f IMAGE REGISTRY:5000/IMAGE
$ docker push REGISTRY:5000/IMAGE
Run Code Online (Sandbox Code Playgroud)
问题
即使大多数 docker 层没有变化,我也需要保存、上传和加载整个 tarball 来推送图像。
我尝试使用 ssh 将 docker 注册表端口(5000)转发到我机器上的端口:
$ ssh -L 5042:REGISTRY:5000 SERVER
Run Code Online (Sandbox Code Playgroud)
现在我可以从我的机器与注册表进行通信:
$ curl localhost:5042/v2/
{}
Run Code Online (Sandbox Code Playgroud)
但是 docker 不会向它推送图像:
$ docker tag IMAGE localhost:5042/IMAGE
$ docker push localhost:5042/IMAGE
The push refers to a repository …Run Code Online (Sandbox Code Playgroud) 我想在运行CentOS7的服务器上安装docker主机(如果重要的话,它在我的PC上的Virtualbox中运行).
我知道有多个云提供商(亚马逊,谷歌,DigitalOcean等)的驱动程序,但如果我想使用自己的私人服务器,我无法弄清楚该做什么.
我尝试使用--driver generic客户操作系统的IP,以及我创建和使用的SSH密钥ssh-keygen,ssh-copy-id但我得到了
$ docker-machine create -d generic --generic-ip-address=<IP> --generic-ssh-key ~/.ss
h/id_rsa --generic-ssh-user <user> centos
Running pre-create checks...
Creating machine...
(centos) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with centos...
Error creating machine: Error running provisioning: exit status 1
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
这与我在Virtualbox中安装CentOS的事实有关吗?
我有两个应用程序,其中一个具有另一个使用的RESTful接口.两者都在同一台机器上运行.
应用程序A在docker容器中运行.我正在使用命令行运行它:
docker run -p 40000:8080 --name AppA image1
Run Code Online (Sandbox Code Playgroud)
当我在docker容器外测试应用程序B时(换句话说,在它被docker化之前)应用程序B成功执行所有RESTful请求并接收响应而没有问题.
不幸的是,当我在一个容器中进行dockerize并运行Application B时:
docker run -p 8081:8081 --name AppB image2
Run Code Online (Sandbox Code Playgroud)
每当我尝试向应用程序A发送RESTful请求时,我都会得到以下信息:
Connect to localhost:40000 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
Run Code Online (Sandbox Code Playgroud)
当然,我也尝试使用我的机器的IP地址连接应用程序B. 当我这样做时,我得到以下失败:
Connect to 192.168.1.101:40000 failed: No route to Host
Run Code Online (Sandbox Code Playgroud)
以前有没有人见过这种行为?是什么原因导致应用程序与docker容器外的另一个dockerized应用程序完美地通信,一旦它本身停靠,就无法与同一个dockerized应用程序通信?
有人请指教......
我每天都在使用docker,但是今天发生了一个问题,没有进行任何更改。我打开了码头,并尝试启动我的一个容器。但是它给出了以下错误:“无法连接,因为目标计算机主动拒绝了它”我正在使用Windows 10。
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com
admin@samsung MINGW64 ~
$ docker ps
An error occurred trying to connect: Get http://127.0.0.1:2375/v1.22/containers/json: dial tcp 127.0.0.1:2375: connectex: No connection could be made because the target …Run Code Online (Sandbox Code Playgroud) 我想知道当我拉出某个图像时,当您运行时docker images会出现“创建”字段,但不会显示图像被拉出的日期。
当我做 :
sudo docker version
Run Code Online (Sandbox Code Playgroud)
我得到了这个错误:
Error response from daemon:client is newer than server (client API version: 1.24, server API version: 1.21)
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我理解我必须做的事情?
我正在尝试在 Fedora OS 版本 25 中使用以下命令创建 docker 机器主机。
docker-machine create -driver=virtualbox host01
Run Code Online (Sandbox Code Playgroud)
执行命令时出现以下错误。
Error with pre-create check: "We support Virtualbox starting with version 5. Your VirtualBox install is \"WARNING:
The vboxdrv kernel module is not loaded.
Either there is no module available for the current kernel (4.10.12-200.fc25.x86_64) or it failed to load.
Please try load the kernel module by executing as root
dnf install akmod-VirtualBox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service
You will not be able to start …Run Code Online (Sandbox Code Playgroud) 是否有任何限制 swarm 为每个工人创建例如 20 个容器。因此,为了更好的 QoS(服务质量),一名工作人员不会拥有超过 20 个容器,这也将防止过度使用主机资源?
谢谢
docker ×10
docker-machine ×10
linux ×2
virtualbox ×2
docker-swarm ×1
macos ×1
networking ×1
rest ×1