Dockerfile 1.6 KB

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