[Solved] Simple Docker starts meteor only after login

I know this is more a Docker than a meteor issue, but maybe there are more that want to try this :slight_smile:

I want to run a very simple dev Docker on WSL, but it throws a

sh: 1: meteor: not found

error when run via docker run -p 3000:3000 meteordev

BUT, when I run it with docker run -it -p 3000:3000 meteordev bash and run npm start on the command line it runs perfectly.

I guess this has to do with how the env is configured for both, but I can’t get it to work, any ideas?

Here ist the full Docker image. If there is another short one, I am happy to drop mine:

# Mini-Docker
FROM node:14

RUN adduser --disabled-password --shell /bin/bash newuser
RUN chown -R newuser /usr/local/lib/node_modules
RUN chown -R newuser /usr/local/bin
USER newuser

COPY --chown=newuser:newuser ./app /home/newuser/app
RUN chmod -R 700 /home/newuser/app/.meteor/local

WORKDIR /home/newuser/app
RUN npm install -g meteor@latest

EXPOSE 3000
CMD ["npm", "start"]

Thanks to the good old Stackoverflow I got the right answer.

Use the following Dockerfile for a dev Docker, maybe the rights can be simplified:

# Mini-Docker
FROM node:14

RUN adduser --disabled-password --shell /bin/bash newuser
RUN chown -R newuser /usr/local/lib/node_modules
RUN chown -R newuser /usr/local/bin
USER newuser

COPY --chown=newuser:newuser ./app /home/newuser/app
RUN chmod -R 700 /home/newuser/app/.meteor/local

WORKDIR /home/newuser/app
RUN npm install -g meteor@latest

EXPOSE 3000
ENV PATH="$PATH:/home/newuser/.meteor"
CMD ["npm", "start"]

Docker kinda sucks and is janky af so you should just set it up normally and avoid it

True, but we want to let somebody try out an app and they don’t know how to install npm, … But they have a lot of Docker. This makes it easy to share for demos :slight_smile:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
It’s a one line install [https://github.com/nvm-sh/nvm](https://github.com/nvm-sh/nvm)
Miles easier then using that pos