Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM rancher/os-rootfs
  2. COPY . /
  3. RUN rm /sbin/poweroff /sbin/reboot /sbin/halt && \
  4. sed -i '/^root/s!/bin/sh!/bin/bash!' /etc/passwd && \
  5. echo 'RancherOS \n \l' > /etc/issue && \
  6. rm -rf /run \
  7. /linuxrc \
  8. /etc/os-release \
  9. /var/cache \
  10. /var/lock \
  11. /var/log \
  12. /var/run \
  13. /var/spool \
  14. /var/lib/misc && \
  15. mkdir -p \
  16. /home \
  17. /run \
  18. /var/cache \
  19. /var/lock \
  20. /var/log \
  21. /var/run \
  22. /var/spool && \
  23. passwd -l root && \
  24. addgroup -g 1100 rancher && \
  25. addgroup -g 1101 docker && \
  26. addgroup -g 1103 sudo && \
  27. adduser -u 1100 -G rancher -D -h /home/rancher -s /bin/bash rancher && \
  28. adduser -u 1101 -G docker -D -h /home/docker -s /bin/bash docker && \
  29. adduser rancher docker && \
  30. adduser rancher sudo && \
  31. adduser docker sudo && \
  32. echo '%sudo ALL=(ALL) ALL' >> /etc/sudoers && \
  33. ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules && \
  34. sed -i s/"partx --update \"\$part\" \"\$dev\""/"partx --update --nr \"\$part\" \"\$dev\""/g /usr/bin/growpart && \
  35. sed -i -e 's/duid/clientid/g' /etc/dhcpcd.conf && \
  36. rm -f /etc/wpa_supplicant.conf && \
  37. ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /lib/dhcpcd/dhcpcd-hooks/ && \
  38. rm -f /usr/share/bash-completion/completions/* && \
  39. chmod 555 /lib/dhcpcd/dhcpcd-run-hooks && \
  40. sed -i 1,10d /etc/rsyslog.conf && \
  41. echo "*.* /var/log/syslog" >> /etc/rsyslog.conf
  42. # dump kernel log to console (but after we've finished booting)
  43. # echo "kern.* /dev/console" >> /etc/rsyslog.conf
  44. ENTRYPOINT ["/usr/bin/ros", "entrypoint"]