Spaces:
Build error
Build error
# 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 | |
# 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"] | |