1

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"]
usrrname
  • 328
  • 2
  • 10
  • What is the command line you use to start the container, what are all of the settings you specified in the docker program UI, and what are the full errors verbatim? Did you try what it suggested by editing Preferences => File Sharing? – Jason Livesay Jan 25 '17 at 01:48
  • @JasonLivesay I think the command line was `docker build -t meanjs/mean .` (success despite lots of red npm info fetch and then retry) then `docker run --name mywebapp -v /Users/firstname.lastname/mean:/usr/src/app/ -p 27017:27017 mywebapp ` this resulted in `Unable to find image 'pedantic_bhaskara:latest' locally docker: Error response from daemon: repository pedantic_bhaskara not found: does not exist or no pull access.` @JasonLivesay – usrrname Jan 25 '17 at 14:16
  • It appears that my docker settings are configured to build from all the right files but perhaps putting my Dockerfile in a projectfolder under my user.name account messed up some paths... This thread made me understand that the `/opt` or `/var` in mappings that a lot of blogs and tutorials refer to are under `Macintosh/` http://stackoverflow.com/questions/38532483/where-is-var-lib-docker-on-mac-os-x?noredirect=1&lq=1 – usrrname Jan 25 '17 at 17:46

0 Answers0