question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem completing "Bind Mounts" section of this tutorial

See original GitHub issue

Hello! I am very much enjoying learning docker through this getting-started tutorial. However, I am having problems completing the Bind Mounts section. It seems the following command is invalid (what is the $PWD doing?):

docker run -dp 3000:3000 \
    -w /app -v $PWD:/app \
    node:12-alpine \
    sh -c "yarn install && yarn run dev"

Also, there do not seem to be full front to back steps on what to do after running this command (which causes an error on my terminal session):

docker: invalid reference format: repository name must be lowercase.

If someone could look into this that would be great - because I’ve already learned a lot in the first several steps!

Thank you much - Andrew

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

4reactions
stetogiascommented, Sep 11, 2020

I’d just like to leave this here as a comment for anyone having a problem

If you run the command outside the app directory it returns and ID, throws no errors but the container is not running. docker ps returns nothing. It would be nice to have this stated in the tutorial.

tried it on linux (Pop!_os) as a non-root user

1reaction
zqcccccommented, May 14, 2020

Thanks! It works!

The only way I could get this section “working” - not sure if it actually works yet, just that it returned a container id, and didn’t throw an error - was by turning the command into a one-liner. From:

docker run -dp 3000:3000 \
    -w /app -v ${PWD}:/app \
    node:12-alpine \
    sh -c "yarn install && yarn run dev"

To:

docker run -dp 3000:3000 -w /app -v ${PWD}:/app node:12-alpine sh -c "yarn install && yarn run dev"

Every time I tried to run it as-is in the tutorial, it’d throw a whole bunch of errors about terms not recognized. I’m using docker desktop on windows with powershell.

Hope this helps someone 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker run command in Getting Started tutorial not working
I have successfully followed tutorial docker/getting-started on localhost but when I came to subject - persisting data using Bind Mounts I ...
Read more >
Bind mounts - Amazon Elastic Container Service
In the containerDefinitions section, define a container with a mountPoints value that references the name of the bind mount and the containerPath value...
Read more >
the docker tutorial, bind mounts section, command given ...
the docker tutorial, bind mounts section, command given produces an error upon execution. Please how do I fix this error? Ask Question.
Read more >
Tutorial: Get started with Docker apps in Visual Studio Code
This tutorial is the beginning of a three-part series introducing Docker ... Containers don't require the size and overhead of a complete ......
Read more >
19.2. Mounting a File System Red Hat Enterprise Linux 7
To attach a certain file system, use the mount command in the following form: ... For a complete list of all available file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found