Hi Everyone,
I’m setting up a Dockerfile to execute mongodump
and mongorestore
commands during the image build and restart process. This setup works perfectly when using the default mongo
image.
However, when switching to the mongodb/mongodb-atlas-local
image, the restore script does not seem to execute.
Here are the key details:
FROM mongo:7.0.11 AS backup
WORKDIR /workspace
COPY --chmod=777 ./backup_data.sh /workspace/
RUN /workspace/backup_data.sh
FROM mongodb/mongodb-atlas-local:latest
COPY --chmod=777 ./restore_data.sh /docker-entrypoint-initdb.d/1_restore_data.sh
COPY --from=backup /workspace/backups /backups
ARG IMAGE_DESCRIPTION
LABEL org.opencontainers.image.description=${IMAGE_DESCRIPTION}
If anyone has experience or ideas on how to address this issue, your help would be greatly appreciated!