make: *** No rule to make target 'build-x86_64'. Stop - docker

I am following a tutorial series on yt https://www.youtube.com/watch?v=FkrpUaGThTQ
how to make an os soo
when in **Build for x86 ** use the command make build-x86_64 then it shows this error `
make: *** No rule to make target 'build-x86_64'. Stop.
`
I dont know how to fix it

Per the original YouTube author of the tutorial, this is the fix :
Try one of the following commands when entering the docker container from your host OS
For Linux, MacOS, WSL, etc :
docker run --rm -it -v "$pwd":/root/env myos-buildenv
docker run --rm -it -v "$PWD":/root/env myos-buildenv
docker run --rm -it -v "$(pwd)":/root/env myos-buildenv
Windows Powershell :
docker run --rm -it -v "${pwd}:/root/env" myos-buildenv
Windows CMD :
docker run --rm -it -v "%cd%":/root/env myos-buildenv

You just need to go back one directory by typing
"cd .."
then enter another command
"cd env" to move into the env folder
then you can enter "make build x86_64" command

Make the "MakeFile" file name as "makefile" and run the command "make build-x86_64"

Same problem I had. Just go on with Carey S.Turner`s answer.
Windows Powershell: docker run --rm -it -v "${pwd}:/root/env" myos-buildenv
Windows CMD: docker run --rm -it -v "%cd%":/root/env myos-buildenv
I had error with cmd but powershell worked fine for me.

I had the same error I found that it could be fixed by doing this bit right
Enter build environment:
Linux or MacOS: docker run --rm -it -v "$(pwd)":/root/env myos-buildenv
Windows (CMD): docker run --rm -it -v "%cd%":/root/env myos-buildenv
Windows (PowerShell): docker run --rm -it -v
"${pwd}:/root/env" myos-buildenv
Please use the linux command if you are using WSL, msys2 or git bash NOTE: If you are having trouble with an unshared drive, ensure your docker daemon has access to the drive you're development environment is in. For Docker Desktop, this is in "Settings > Shared Drives" or "Settings > Resources > File Sharing".
(https://github.com/davidcallanan/os-series/blob/ep1/README.md)
My error came out of me not doing the "$(pwd)" bit correctly

Related

docker with makefile volume mounts

So recently came across this weird case where I am trying to access file in my local dir into my container.
When I run the following command on terminal it runs fine and shows the expected list of file
docker run -it --rm -v $(pwd):/mnt/data -w /mnt/data-sink artprod.dev.abc.com/org/cli ls
But when I try to run this via makefile it shows nothing,(I run make in the same path where I run the docker cmd in the previous step)
docker-publish: build
echo "Publishing $(APP_NAME) snapshot $(VERSION)"
docker run -it --rm -v $(pwd):/mnt/data -w /mnt/data-sink artprod.dev.abc.com/org/cli ls
$(shell pwd) worked simply $(pwd) in make didnt do the shell interpolation.

Docker cant find file location in windows 10

I am trying to run a software for predicting hemorrhage volume on brain CT in docker: https://github.com/msharrock/deepbleed
I created a "deepbleed" folder in my D:\ drive on windows, and ran docker pull msharrock/deepbleed command after I cd'd inside that directory. The pull was successful and I can see the container in my docker desktop app.
Then I went on and created an indir and outdir folder as instructed in documentation; placed my CT file for prediction in the indir folder.
The readme tells me to run this command next:
docker run -it msharrock/deepbleed bash -v /path/to/data:/data/
So I have run the following commands, but I get "no such file or directory" for all of them:
docker run --rm -it msharrock/deepbleed bash -v pwd/deepbleed/indir:outdir
docker run --rm -it msharrock/deepbleed bash -v ~/deepbleed/indir:/outdir/
docker run --rm -it msharrock/deepbleed bash -v /mnt/d/deepbleed/indir:/outdir/
docker run --rm -it msharrock/deepbleed bash -v /d/deepbleed/indir:/outdir
docker run --rm -it msharrock/deepbleed bash -v "$(& "D:\deepbleed\indir" "$(pwd)")":/outdir
docker run --rm -it msharrock/deepbleed bash -v /indir/:/outdir/
docker run --rm -it msharrock/deepbleed bash -v //d:/deepbleed/indir://d:/deepbleed/outdir/
docker run --rm -it msharrock/deepbleed bash -v //d/deepbleed/indir://d/deepbleed/outdir/
docker run --rm -it msharrock/deepbleed bash -v //d/deepbleed/indir:/outdir/
My docker is running on a wsl2 based engine in windows 10, the hyper-v folders for disks and virtual machines are located on my d: drive.
What do I need to do to get this running?
Try doing it like this (just using one of your items in the list for this example to give you the idea):
docker run -rm -it -v /mnt/d/deepbleed/indir:/outdir msharrock/deepbleed bash

How to run commands in Docker container

Hello I m trying to follow the step by step guid to build jpeg xl (I m on windows and try to build a x64 version for linux)
after:
docker run -u root:root -it --rm -v C:\Users\fred\source\tools\jpegxl\jpeg-xl-master -w /jpeg-xl gcr.io/jpegxl/jpegxl-builder
I have the container running but I don't know how to run the command inside :
CC=clang-6.0 CXX=clang++-6.0 ./ci.sh opt
I tried CC=clang-6.0 CXX=clang++-6.0 ./ci.sh opt and I get ./ci.sh: No such file or directory no command seems to work when I do "ls" it display nothing
Does someone knows how to get this to build?
Make sure that you start a bash terminal inside the container:
docker run -it <image> /bin/bash
I believe /bin/bash is missing from your docker run command. As a result, you are executing the command for clang inside your own environment, not the container.
You can set the environment variables by using -e
Example
-e CC=clang-6.0 -e CXX=clang++-6.0
The full command to log in into your container:
docker run -u root:root -it --rm -e CC=clang-6.0 -e CXX=clang++-6.0 -v C:\Users\fred\source\tools\jpegxl\jpeg-xl-master -w /jpeg-xl gcr.io/jpegxl/jpegxl-builder /bin/bash
They have updated the image without updating the command so the command is
CC=clang-7 CXX=clang++-7 ./ci.sh opt
The discution is here:
Can't build from docker image "Unknown clang version"

docker : can't mount some directory from host

I have the latest centos image for docker and the host machine is ubuntu.
i'm having some script at my host machine, with the path:
/home/username/untitled1/preReq.sh
i'm trying to execute this script, inside my centos docker.
while i'm mounting the directory of the script, i can't see anything and it appears that i'm mounting the root directory.
i'm using this command (from ~)
docker run --rm -it -v ${PWD}:/untitled1 centos
someone know how to fix it?
either use the pwd command (without caps) if you're in the directory:
docker run --rm -it -v ${pwd}:/untitled1 centos
or use $HOME environment variable if you're running with that user:
docker run --rm -it -v ${HOME}:/untitled1 centos
I would suggest
docker run --rm -it -v `pwd`:/untitled1 centos
At least that works for me.
${X}
evaluates the environment variable X. PWD is typically set by your shell:
$ export
[...]
declare -x PWD="/home/user"
[...]
pwd on the other hand is a program producing the current working directory to STDOUT:
$ whereis pwd
pwd: /bin/pwd /usr/include/pwd.h /usr/share/man/man1/pwd.1.gz
$ pwd
/home/user
With the previous docker command the program is executed and its STDOUT is inserted producing:
docker run --rm -it -v /home/user:/untitled1 centos

Mount a host file as a data volume in docker

I am following this docker user guide: Managing Data in Containers
It seem to be a error at "Mount a Host File as a Data Volume" part,
$ sudo docker run --rm -it -v ~/.bash_history:/.bash_history ubuntu /bin/bash
I test it in my mac version docker, it should be like this:
$ sudo docker run --rm -it -v ~/.bash_history:/root/.bash_history ubuntu /bin/bash
I am not sure if am I correct about this.
You can't use -v option with relative path. You need to use absolute path instead:
sudo docker run --rm -it -v /home/<your_user>/.bash_history:/.bash_history ubuntu /bin/bash

Resources