Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. FROM dockage/alpine:3.7
  2. MAINTAINER Mohammad Abdoli Rad <m.abdolirad@gmail.com>
  3. LABEL org.label-schema.name="alpine-openrc" \
  4. org.label-schema.vendor="Dockage" \
  5. org.label-schema.description="Docker image uses openRC as a process supervision on Alpine Linux" \
  6. org.label-schema.vcs-url="https://github.com/dockage/alpine-openrc" \
  7. org.label-schema.version="3.7" \
  8. org.label-schema.license="MIT"
  9. RUN set -x \
  10. && apk add --update --no-cache openrc \
  11. # Disable getty's
  12. && sed -i 's/^\(tty\d\:\:\)/#\1/g' /etc/inittab \
  13. && sed -i \
  14. # Change subsystem type to "docker"
  15. -e 's/#rc_sys=".*"/rc_sys="docker"/g' \
  16. # Allow all variables through
  17. -e 's/#rc_env_allow=".*"/rc_env_allow="\*"/g' \
  18. # Start crashed services
  19. -e 's/#rc_crashed_stop=.*/rc_crashed_stop=NO/g' \
  20. -e 's/#rc_crashed_start=.*/rc_crashed_start=YES/g' \
  21. # Define extra dependencies for services
  22. -e 's/#rc_provide=".*"/rc_provide="loopback net"/g' \
  23. /etc/rc.conf \
  24. # Remove unnecessary services
  25. && rm -f /etc/init.d/hwdrivers \
  26. /etc/init.d/hwclock \
  27. /etc/init.d/hwdrivers \
  28. /etc/init.d/modules \
  29. /etc/init.d/modules-load \
  30. /etc/init.d/modloop \
  31. # Can't do cgroups
  32. && sed -i 's/cgroup_add_service /# cgroup_add_service /g' /lib/rc/sh/openrc-run.sh \
  33. && sed -i 's/VSERVER/DOCKER/Ig' /lib/rc/sh/init.sh
  34. WORKDIR /etc/init.d
  35. CMD ["/sbin/init"]