Dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. RUN sed -i s/"partx --update \"\$part\" \"\$dev\""/"partx --update --nr \"\$part\" \"\$dev\""/g /usr/bin/growpart && \
  37. sed -i -e 's/duid/clientid/g' /etc/dhcpcd.conf
  38. ENTRYPOINT ["/usr/bin/ros", "entrypoint"]