Welcome to the Linux Foundation Forum!

05. Revision Control issue. Bind mounts in Linux.

I had an issue with the docker run "-v" option in the example provided. I'm using Ubuntu 18.04. I had a folder called /app but it was empty. I used the following command and it seemed to work fine but I wanted to check I was doing the correct thing:

docker run --rm -it --mount type=bind,source="$(pwd)",target=/app maven:alpine sh

Obviously, I'm in the folder with the correct files required. If possible, can there be examples included for Linux users if they appear to be different to Windows/MacOs Git Bash users?

Thanks. I'm finding this course very useful by the way.

Comments

  • luisviveropena
    luisviveropena Posts: 811

    Hi @mikerossiter ,

    What chapter and section are you talking about? Is it Chapter 5 REVISION CONTROL WITH GIT item Leveraging Docker to Simplify Development?

    If so, the command I see we are using it's the following:

    docker container run -it --rm -v :/app maven:alpine sh

    In my case (I'm on macOS) it's:

    docker container run -it --rm -v /Users/luiseduardo/Documents/IT/LF/Courses/LFS261/devops-repo/hellocd:/app maven:alpine sh

    So, when I get to the shell (which is sh in this case) inside the docker container, I go to /app and I see the same files I have on /Users/luiseduardo/Documents/IT/LF/Courses/LFS261/devops-repo/hellocd .

    Perhaps you have an old copy of the Labs PDF file.

    Regards,
    Luis.

Categories

Upcoming Training