Skip to content

Instantly share code, notes, and snippets.

@sgwd
Forked from bsod90/Dockerfile
Created May 2, 2018 21:39
Show Gist options
  • Save sgwd/49fb40b500f3a1072ee7f59e29b83bbc to your computer and use it in GitHub Desktop.
Save sgwd/49fb40b500f3a1072ee7f59e29b83bbc to your computer and use it in GitHub Desktop.

Revisions

  1. @bsod90 bsod90 created this gist Jan 17, 2018.
    27 changes: 27 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    FROM centos:7
    MAINTAINER "orion" <[email protected]>

    # Steps needed to use systemd enabled docker containers.
    # Reference: https://hub.docker.com/_/centos/
    ENV container docker
    RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
    systemd-tmpfiles-setup.service ] || rm -f $i; done); \
    rm -f /lib/systemd/system/multi-user.target.wants/*;\
    rm -f /etc/systemd/system/*.wants/*;\
    rm -f /lib/systemd/system/local-fs.target.wants/*; \
    rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
    rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
    rm -f /lib/systemd/system/basic.target.wants/*;\
    rm -f /lib/systemd/system/anaconda.target.wants/*;

    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

    EXPOSE 22

    CMD ["/usr/sbin/init"]