Vagrant VM 내부의 Redis를 실행하는 Docker 컨테이너를 갖고 싶습니다. 나는 가능한 한 간단 할 수있는 것들을 원하기 때문에 최소한의 구성이 필요합니다.Docker + Vagrant에 Redis를 설치하는 가장 간단한 방법은 무엇입니까
연구의 조금을 보여줍니다
- 방랑은 Docker provisioner
- 도커는 신뢰 Dockerfile for Redis
그래서 설치가 정말 정직해야합니다 제공, 난 그냥에 미칠 것으로 예상 점들을 이으세요. 그래서 나는 이걸 가지고 다가왔다. Vagrantfile
:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "chef/centos-6.5"
config.vm.provision "docker" do |docker|
docker.run "dockerfile/redis"
end
end
외모는 간단하다. 이제 vagrant up
을 실행하면 다음과 같이 나타납니다.
- VM이 시작됩니다.
- Docker가 설치됩니다.
- Docker 데몬
dockerd
이 시작되었습니다. - Redis
dockerfile/redis
용 Docker 컨테이너가 다운로드되어 설치됩니다. - 컨테이너가 시작되었습니다. 이
Vagrantfile
와 내가 얻을 이후
모두 3 단계를 제외하고 작동하는 것 같다 :
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 192.168.249.190:22
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection refused. Retrying...
==> default: Machine booted and ready!
==> default: Forwarding ports...
default: -- 22 => 2222
==> default: Configuring network adapters within the VM...
==> default: Waiting for HGFS kernel module to load...
==> default: Enabling and configuring shared folders...
default: -- /Users/ernst/nikon/nikon-elk-vm2: /vagrant
==> default: Running provisioner: docker...
default: Installing Docker (latest) onto machine...
default: Configuring Docker to autostart containers...
==> default: Starting Docker containers...
==> default: -- Container: dockerfile/redis
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
rm -f /var/lib/vagrant/cids/cc3cfcdebad9167099d85261c6311a0011838655
docker run --cidfile=/var/lib/vagrant/cids/cc3cfcdebad9167099d85261c6311a0011838655 -d --name dockerfile-redis dockerfile/redis
Stdout from the command:
Stderr from the command:
2014/11/26 12:38:40 Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
내가 분명히 shell
제공자를 사용하여 되돌릴 수 있지만 내 Vagrantfile
간단한을 유지하기 위해 사랑하고를 사용합니다 Vagrant가 제공하는 docker
공급자.
그래서 나는 무엇을 놓치고 있습니까?
레디 스의 offical 한 신뢰 구축이 (HTTPS 여기 그런데 : //registry.hub.docker
나는이 Vagrantfile 성공했다. co.kr/_/redis /)에 연결하십시오. 당신이 링크 한 것은 readme에서 신뢰할 수 있습니다. 소유자는 도커 아이콘을 사용했고 신뢰할 수없는 단어는 부적절하다고 생각합니다. dockerhub의 repo 이름과 "Official Repo"텍스트 뒤에 파란색 리본이 있는지 확인하십시오. –Usman : 감사합니다! 좀 더 손길을 피우지 만 실제 공식 빌드로 전환합니다. 사실 그것은 잠재적으로 불성실 한 것처럼 보입니다. –
나는 당신의 질문에 대답 할 수 없으므로 항해자와 도커를 사용하지는 않았지만, 방황보다는 boot2docker를 실행하는 것이 더 나았습니다. 가능한 한 단순한 것을 원한다면 대신 사용할 수 있습니다. –