You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anyone have any ideas on how to get this to work? I'm just trying to run my mongorestore after the mongo db has started.
When I execute the following scripts I get the following error message:
2017-07-25T00:05:48.352+0000 Failed: error connecting to db server: no reachable servers
The text was updated successfully, but these errors were encountered:
ikemtz
changed the title
Docker Newbie question: How to run shell script in docker file
Docker Newbie question: How to run shell script in docker file (post startup)
Jul 25, 2017
Have you tried /docker-entrypoint-initdb.d/? It was added in #145. I still consider it experimental (which is why it is not documented), but it should work similar to mysql and postgres.
I'm trying to run a mongorestore command as part of my docker file. I'm thinking that this should be a pretty straight forward thing to do.
Here's my docker file:
FROM mongo:latest
RUN mongodump -h xxxxxx -u xxxxx -p xxxxxx --ssl --sslAllowInvalidCertificates -d xxxxx --gzip --archive=DbArchive.archive
EXPOSE 27018:27017
ENV AUTH no
ENV JOURNALING no
RUN mkdir -p /usr/src/db
COPY ./*.sh /usr/src/db/
RUN chmod +x /usr/src/db/restoreDb.sh
#CMD /bin/sh ./usr/src/db/restoreDb.sh
Here's my restoreDb.sh script
sleep 60
mongorestore --archive=DbArchive.archive --gzip --db xxxxxxx
Anyone have any ideas on how to get this to work? I'm just trying to run my mongorestore after the mongo db has started.
When I execute the following scripts I get the following error message:
2017-07-25T00:05:48.352+0000 Failed: error connecting to db server: no reachable servers
The text was updated successfully, but these errors were encountered: