Skip to content

Instantly share code, notes, and snippets.

Last active April 21, 2022 15:16
What would you like to do?
Docker-in-Docker with Amazon Linux 2 Container
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/; \
for i in *; do [ $i = systemd-tmpfiles-setup.service ] || rm -f $i; done
RUN rm -f /lib/systemd/system/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/* \
/lib/systemd/system/*udev* \
/lib/systemd/system/*initctl* \
/lib/systemd/system/* \
RUN amazon-linux-extras install epel docker && \
systemctl enable docker
CMD ["/usr/sbin/init"]
Copy link

toricls commented Jul 16, 2021

docker build -t ecs-anywhere-node .

docker run -d --privileged \
  --name ecs-anywhere \
  -p 8080-8090:8080-8090 ecs-anywhere-node:latest

docker exec -it ecs-anywhere /bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment