Skip to content

Instantly share code, notes, and snippets.

@simmessa
Created July 19, 2019 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simmessa/5304c435b62739f4b86946a4f653c1be to your computer and use it in GitHub Desktop.
Save simmessa/5304c435b62739f4b86946a4f653c1be to your computer and use it in GitHub Desktop.
FROM oraclelinux:7.6
ENV container docker
RUN yum -y update; yum clean all
RUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs dbus fsck.ext4
RUN systemctl mask dev-mqueue.mount dev-hugepages.mount \
systemd-remount-fs.service sys-kernel-config.mount \
sys-kernel-debug.mount sys-fs-fuse-connections.mount \
display-manager.service graphical.target systemd-logind.service
RUN yum -y install openssh-server sudo openssh-clients
RUN sed -i 's/#PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN ssh-keygen -q -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa && \
ssh-keygen -q -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa && \
ssh-keygen -q -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
RUN echo 'root:root' | chpasswd
RUN systemctl enable sshd.service
# firewalld needs this .. and I needs my firewalld
ADD dbus.service /etc/systemd/system/dbus.service
RUN systemctl enable dbus.service
VOLUME [ "/sys/fs/cgroup" ]
VOLUME ["/run"]
EXPOSE 22
CMD ["/usr/sbin/init"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment