John
John

Reputation: 1011

Docker not syncing files on linux

I have a project that looks as such:

enter image description here

First I run:

sudo docker build buildnev -t myos-buildenv 

Then:

sudo docker run --rm -it -v Spwd:/root/env myos-buildenv 

But the files are not shared and I cannot run Make from the docker

How can I fix that?

This is my Dockerfile:

FROM randomdude/gcc-cross-x86_64-elf

RUN apt-get update 
RUN apt-get upgrade -y
RUN apt-get install -y nasm xorriso grub-pc-bin grub-common

VOLUME /root/env
WORKDIR /root/env

Upvotes: 0

Views: 351

Answers (1)

cam
cam

Reputation: 5198

Your run command isn't mounting your current directory, unless it's a typo you haven't corrected yet. When I posted this, it read sudo docker run --rm -it -v Spwd:/root/env myos-buildenv .

I think you meant $PWD or $(pwd) , like this:

sudo docker run --rm -it -v $PWD:/root/env myos-buildenv 

Upvotes: 3

Related Questions