Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Centos 7 with Systemd Dockerfile
FROM centos:7
MAINTAINER "orion" <>
# Steps needed to use systemd enabled docker containers.
# Reference:
ENV container docker
RUN (cd /lib/systemd/system/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/*; \
rm -f /lib/systemd/system/*udev*; \
rm -f /lib/systemd/system/*initctl*; \
rm -f /lib/systemd/system/*;\
rm -f /lib/systemd/system/*;
RUN yum install -y glibc-common && yum clean all
# Locale. Needed for postgres.
# Centos does not have locale-gen, the equivalent command is localedef.
RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8
RUN localedef -c -f UTF-8 -i ja_JP ja_JP.UTF-8
RUN localedef -c -f UTF-8 -i de_DE de_DE.UTF-8
RUN localedef -c -f UTF-8 -i af_ZA af_ZA.UTF-8
CMD ["/usr/sbin/init"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment