title: How to install git on a docker ubuntu image?
body: <p>I have a simple docker file of</p>
  
  <pre><code>FROM ubuntu:18.04
  COPY . /usr/src/app/
  COPY docker_files/.bash_aliases /root/
  
  $ docker build -t dock .
  Sending build context to Docker daemon  146.9kB
  Step 1/3 : FROM ubuntu:18.04
   ---&gt; 94e814e2efa8
  Step 2/3 : COPY . /usr/src/app/
   ---&gt; bf79eb6c42c1
  Step 3/3 : COPY docker_files/.bash_aliases /root/
   ---&gt; aedc97d5ee8b
  Successfully built aedc97d5ee8b
  Successfully tagged dock:latest
  </code></pre>
  
  <p>I can use it:</p>
  
  <pre><code>$ docker run -it dock
  bash: git: command not found
  root@6a6bec871690:/# ls usr/src/app/
  Dockerfile  Gemfile  Gemfile.lock  README.md  docker_files  go  ...
  root@6a6bec871690:/# 
  </code></pre>
  
  <p>and as you see my files were copied and aliases created for root.  However git was not found (hence the err msg) and not installed.<br>
  How do I install it given my attempt below failed?</p>
  
  <pre><code>root@753b573271d5:/# git
  bash: git: command not found
  root@753b573271d5:/# apt-get install git
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  E: Unable to locate package git
  root@753b573271d5:/# sudo apt-get install git 
  bash: sudo: command not found
  </code></pre>