Last active
April 26, 2023 23:49
-
-
Save toricls/e17c7f2f1c024cc368dcd860804194f5 to your computer and use it in GitHub Desktop.
Docker-in-Docker with Amazon Linux 2 Container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM amazonlinux:2 | |
RUN yum -y update \ | |
# systemd is not a hard requirement for Amazon ECS Anywhere, but the installation script currently only supports systemd to run. | |
# Amazon ECS Anywhere can be used without systemd, if you set up your nodes and register them into your ECS cluster **without** the installation script. | |
&& yum -y install systemd \ | |
&& yum clean all | |
RUN cd /lib/systemd/system/sysinit.target.wants/; \ | |
for i in *; do [ $i = systemd-tmpfiles-setup.service ] || rm -f $i; done | |
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ | |
/etc/systemd/system/*.wants/* \ | |
/lib/systemd/system/local-fs.target.wants/* \ | |
/lib/systemd/system/sockets.target.wants/*udev* \ | |
/lib/systemd/system/sockets.target.wants/*initctl* \ | |
/lib/systemd/system/basic.target.wants/* \ | |
/lib/systemd/system/anaconda.target.wants/* | |
RUN amazon-linux-extras install epel docker && \ | |
systemctl enable docker | |
CMD ["/usr/sbin/init"] |
Author
toricls
commented
Jul 16, 2021
Been looking to do this all week unfortunately your solution doesn't seem to work better than any other
docker image ls
gives the usual
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
@tjtaill According to the error message you got, it looks you need to run Docker daemon beforehand.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment