I've read other threads on here about using meanjs/mean image.
I believe I have a few things to work out. I have found docker pull
, docker build
, docker run
, docker exec
are fairly straightforward. But I have the following issues:
1) When I try to point a local dir to the container's db: a lot of errors thrown regarding there being no package.json... so... I include npm init
and npm express -g install
in my folder
2) At one point I started using kitematic to see whether it is running, while it says my container is running, trying to do
docker exec 1daeb30a3c9e -ti /bin/bash
throws error:
container_linux.go:247: starting container process caused "exec: \"-ti\": executable file not found in $PATH
3) Trying to map local mongo data/db to container as a volume results in:
The path /opt/mongodb
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
Am I wrong to be running docker in Users/myUsername/ on macOS ?
my Dockerfile as of now:
FROM node
EXPOSE 27017
WORKDIR {"$PWD"}
# Create app directory
RUN mkdir -p src/app
RUN mkdir -p data/db
RUN touch package.json
VOLUME ["/data/db"]
# Install app dependencies
COPY package.json {"$PWD"}/src/app/
RUN npm install -g express
RUN npm init
RUN npm install --save
# Bundle app source
COPY . {"$PWD"}/src/app
CMD ["npm", "start"]