File size: 1,097 Bytes
e7dccbd
6abf46b
6723c3c
e7dccbd
 
 
a57ffa2
e7dccbd
 
 
1fa864d
 
 
f46a386
 
e7dccbd
1fa864d
a57ffa2
 
 
 
e7dccbd
 
 
 
 
15d3c02
 
 
 
 
 
 
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
33
34
# 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 ./

# Switch to root user to copy start.sh, make it executable, and install curl
# These operations require root privileges
USER root
COPY start.sh ./
RUN chmod +x ./start.sh
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

# Set our custom start.sh script as the ENTRYPOINT
# This ensures start.sh is the main process that gets executed
ENTRYPOINT ["./start.sh"]

# CMD can be left empty or provide default arguments to ENTRYPOINT if needed.
# In this case, start.sh handles everything.
CMD []