File size: 975 Bytes
e7dccbd
6abf46b
6723c3c
e7dccbd
 
 
a57ffa2
e7dccbd
 
 
f46a386
 
 
 
a57ffa2
 
e7dccbd
a57ffa2
 
 
 
e7dccbd
 
 
 
 
f46a386
 
 
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
# Use the rootless Docker-in-Docker base image
FROM docker:dind-rootless

# Set the working directory inside the container
WORKDIR /app

# Copy the Nginx app's index.html and its Dockerfile (exdocker) into this container
COPY index.html ./
COPY exdocker ./

# Copy the start.sh script and make it executable
COPY start.sh ./
RUN chmod +x ./start.sh

# Switch to root user to install curl, as apk requires root privileges
USER root
RUN apk add --no-cache curl
# Switch back to the default non-root user for dind-rootless (usually 'docker')
# This is important for security and proper operation of the rootless daemon
USER docker

# Expose a port from this DinD container.
# We'll map the inner Nginx container's port 80 to this port (e.g., 8080)
# within the DinD container. Then, we can map this 8080 to the host.
EXPOSE 8080

# The base image's ENTRYPOINT is already `dockerd-rootless.sh`.
# We override the default CMD to run our custom start.sh script.
CMD ["./start.sh"]