title: OSDev - Error when using the 'make' command in 'docker'
body: <p>I started writing an OS kernel using the tutorial in <a href="https://www.youtube.com/watch?v=FkrpUaGThTQ" rel="nofollow noreferrer">this video</a>. I've already written the <code>Makefile</code> as you can see here:</p>
  <pre><code>x86_64_asm_source_files := $(shell find src/impl/x86_64 -name *.asm)  # Holds the list of all of the assembly source files.
  x86_64_asm_object_files := $(patsubst src/impl/x86_64/%.asm, build/x86_64/%.o, $(x86_64_asm_source_files))  # Holds the list of all of the obj files.
  
  # Define the command we need to run to build one of the object files from the source files:
  $(x86_64_asm_object_files): build/x86_64/%.o : src/impl/x86_64/%.asm
  # For compiling the assembly files:
      mkdir -p $(dir $@) &amp;&amp; \
      nasm -f elf64 $(patsubst build/x86_64/%.o, src/impl/x86_64/%.asm, $@) -o $@
  
  # Create a custom phony command:
  .PHONY: build-x86_64
  
  # Run only if any of the object files have been changed:
  build-x86_64: $(x86_64_asm_object_files)
  # For generating the '.iso' file:
      mkdir -p dist/x86_64 &amp;&amp; \
      x86_64-elf-ld -n -o dist/x86_64/kernel.bin -T targets/x86_64/linker.ld $(x86_64_asm_object_files) &amp;&amp; \
      cp dist/x86_64/kernel.bin targets/x86_64/iso/boot/kernel.bin &amp;&amp; \
      grub-mkrescue /usr/lib/grub/i386-pc -o dist/x86_64/kernel.iso targets/x86_64/iso
  </code></pre>
  <p>When I run <code>make build-x86_64</code> inside a docker container, I get this error:</p>
  <pre><code>make: *** No rule to make target 'build-x86_64'.  Stop.
  </code></pre>
  <p>When I write the <code>make</code> command only it seems that there is no <code>makefile</code> due to this error:</p>
  <pre><code>make: *** No targets specified and no makefile found.  Stop.
  </code></pre>
  <p>When I use the <code>make</code> command outside of docker, I get:</p>
  <pre><code>mkdir -p build/x86_64/boot/ &amp;&amp; \
  nasm -f elf64  src/impl/x86_64/boot/main.asm -o build/x86_64/boot/main.o
  mkdir -p build/x86_64/boot/ &amp;&amp; \
  nasm -f elf64  src/impl/x86_64/boot/header.asm -o build/x86_64/boot/header.o
  mkdir -p dist/x86_64 &amp;&amp; \
  x86_64-elf-ld -n -o dist/x86_64/kernel.bin -T targets/x86_64/linker.ld  build/x86_64/boot/main.o  build/x86_64/boot/header.o   &amp;&amp; \
  cp dist/x86_64/kernel.bin targets/x86_64/iso/boot/kernel.bin &amp;&amp; \
  grub-mkrescue /use/lib/grub/i386-pc -o dist/x86_64/kernel.iso targets/x86_64/iso
  /bin/sh: 2: x86_64-elf-ld: not found
  make: *** [Makefile:16: build-x86_64] Error 127
  </code></pre>
  <p>The docker command I use for building the docker itself is: <code>sudo docker build buildenv -t learnos-buildenv</code></p>
  <p>The docker command I use for running the docker terminal is: <code>sudo docker run --rm -it -v /root/env learnos-buildenv</code></p>
  <p>Is there anything I can do to fix <code>docker</code>? Or how can I get the <code>x86_64-elf-ld</code> compiler without using <code>docker</code>?</p>
  <p>(My development OS is Ubuntu 20.04.2.0 LTS.)</p>