-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
32 lines (27 loc) · 1.5 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM alpine:3.19.0
RUN apk add --no-cache openssh tcpdump curl mtr nmap nmap-nping bind-tools nginx stress-ng jq aws-cli
ADD files/ /files/
# Installing/Configuring SSH for access
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa && \
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa && \
ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa && \
ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519 && \
sed -i "s/#Port 22/Port 8022/" /etc/ssh/sshd_config && \
mkdir /root/.ssh && \
# Temporary hack to ensure ssh keys still work
passwd -d root && \
# Configure some of the basics of nginx
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log && \
ln -sf /files/nginx_default.conf /etc/nginx/http.d/default.conf && \
ln -sf /files/nginx.conf /etc/nginx/nginx.conf && \
mkdir -p /usr/share/nginx/html && \
echo "Hello World!!!" > /usr/share/nginx/html/index.html && \
# Configure the importing of all environment variables from pid 1 to make use of the ECS specific environment variables(Task Roles) for the awscli
echo 'export $(strings /proc/1/environ)' > /root/.profile && \
# Changing the motd to remember the above configuration
printf '\n\nNOTICE: export $(strings /proc/1/environ) is run on the ash shell profile which makes the aws cli work with Task Roles.\nc' > /etc/motd
COPY ./testing.pub /root/.ssh/authorized_keys
COPY ./www.example.com.crt /etc/nginx
COPY ./www.example.com.key /etc/nginx
CMD [ "/files/entrypoint.sh" ]