Can't install Docker on CentOS 7 running on Vagrant

≯℡__Kan透↙ 提交于 2019-12-10 22:37:46

问题


Brand new instance using Vagrant file

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "chef/centos-7.0"
  config.vm.network "forwarded_port", guest: 3000, host: 3007
end

Then ran the following commands

vagrant up
vagrant ssh
sudo su
yum install -y docker
systemctl status docker.service

which all ran fine.

Then the errors:

[root@localhost vagrant]# sudo systemctl start docker
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
[root@localhost vagrant]# systemctl status docker.service -l
docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
   Active: failed (Result: exit-code) since Fri 2015-04-03 18:56:57 UTC; 26min ago
     Docs: http://docs.docker.com
  Process: 10359 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=127)
 Main PID: 10359 (code=exited, status=127)

Apr 03 18:56:57 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
Apr 03 18:56:57 localhost.localdomain docker[10359]: time="2015-04-03T18:56:57Z" level="info" msg="+job serveapi(unix:///var/run/docker.sock)"
Apr 03 18:56:57 localhost.localdomain docker[10359]: /usr/bin/docker: relocation error: /usr/bin/docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
Apr 03 18:56:57 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=127/n/a
Apr 03 18:56:57 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Apr 03 18:56:57 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
[root@localhost vagrant]# journalctl -xn
-- Logs begin at Fri 2015-04-03 18:41:26 UTC, end at Fri 2015-04-03 19:01:01 UTC. --
Apr 03 19:01:01 localhost.localdomain CROND[10368]: (root) CMD (run-parts /etc/cron.hourly)
Apr 03 19:01:01 localhost.localdomain run-parts(/etc/cron.hourly)[10371]: starting 0anacron
Apr 03 19:01:01 localhost.localdomain anacron[10377]: Anacron started on 2015-04-03
Apr 03 19:01:01 localhost.localdomain anacron[10377]: Will run job `cron.daily' in 35 min.
Apr 03 19:01:01 localhost.localdomain anacron[10377]: Will run job `cron.weekly' in 55 min.
Apr 03 19:01:01 localhost.localdomain anacron[10377]: Will run job `cron.monthly' in 75 min.
Apr 03 19:01:01 localhost.localdomain anacron[10377]: Jobs will be executed sequentially
Apr 03 19:01:01 localhost.localdomain run-parts(/etc/cron.hourly)[10379]: finished 0anacron
Apr 03 19:01:01 localhost.localdomain run-parts(/etc/cron.hourly)[10381]: starting 0yum-hourly.cron
Apr 03 19:01:01 localhost.localdomain run-parts(/etc/cron.hourly)[10385]: finished 0yum-hourly.cron

Ideas as to how to get this working?


回答1:


You need to install device-mapper-event-libs and then it works. Just do sudo yum install device-mapper-event-libs after you install docker.



来源:https://stackoverflow.com/questions/29438648/cant-install-docker-on-centos-7-running-on-vagrant

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!