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 bash and curl | |
# These operations require root privileges | |
USER root | |
COPY start.sh ./ | |
RUN chmod +x ./start.sh | |
RUN apk add --no-cache bash curl # Ensure bash is available for start.sh | |
# 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 [] | |