Advertisement
Guest User

rootfs

a guest
May 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. [root@ip-172-18-0-155 origin]# ll $(which docker)
  2. -rwxr-xr-x. 1 root root 965 May 25 11:16 /usr/local/bin/docker
  3. [root@ip-172-18-0-155 origin]# cat /usr/local/bin/docker
  4. #!/bin/sh
  5.  
  6. # We need to ensure that the version of docker we're running inside the
  7. # container matches that of the host. A newer version of docker client against
  8. # and older daemon is known not to work and older versions of the client
  9. # against newer versions of the daemon aren't widely tested. So therefore we
  10. # rely on running docker from the host's filesystem which we expect to be
  11. # mounted at /rootfs. Docker on the host can be upgraded without a corresponding
  12. # update to the node image and that update may add dependencies like libseccomp
  13. # that aren't available inside our node image. By chroot'ing to /rootfs we can
  14. # ensure that as long as the host has a valid install things will work.
  15.  
  16. # NOTE: This means that anything inside the node container needs to call
  17. # `docker` or `/usr/local/bin/docker`. We're not replacing /usr/bin/docker
  18. # because most installs currently mount /usr/bin/docker from the host into that
  19. # path.
  20.  
  21. chroot /rootfs docker "${@}"
  22.  
  23. [root@ip-172-18-0-155 origin]# docker
  24. chroot: cannot change root directory to /rootfs: No such file or directory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement