title: Dockerfile Permission denied during RUN apt-get update
body: <p>I am getting permission denied on RUN apt-get update within my Dockerfile , this is  the content of the file:</p>
  <pre><code>FROM ubuntu:bionic
  RUN whoami 
  RUN apt-get update &amp;&amp; \ 
  apt-get -y upgrade &amp;&amp; \ 
  apt-get install -y sudo
  </code></pre>
  <p>when I try running RUN whoami at the top, I see 'root' printed to screen. I tried searching online but nothing seems relevant to this error message.</p>
  <pre><code>W: Unable to read /etc/apt/apt.conf.d/ - opendir (13: Permission denied)
  W: Unable to read /etc/apt/sources.list.d/ - opendir (13: Permission denied)
  W: GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
  E: The repository 'http://security.ubuntu.com/ubuntu bionic-security InRelease' is not signed.
  W: GPG error: http://archive.ubuntu.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
  E: The repository 'http://archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
  W: GPG error: http://archive.ubuntu.com/ubuntu bionic-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
  E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates InRelease' is not signed.
  W: GPG error: http://archive.ubuntu.com/ubuntu bionic-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
  E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports InRelease' is not signed.
  E: Unable to read /var/cache/apt/ - opendir (13: Permission denied)
  E: Unable to read /var/cache/apt/ - opendir (13: Permission denied) 
  </code></pre>
  <p>I noticed my Docker version seems out-dated but I ran <code>sudo yum update</code> and it tells me everything is already up to date.</p>
  <pre><code>Client:
   Version:         1.13.1
   API version:     1.26
   Package version: docker-1.13.1-206.git7d71120.el7_9.x86_64
   Go version:      go1.10.3
   Git commit:      7d71120/1.13.1
   Built:           Wed May 19 02:56:06 2021
   OS/Arch:         linux/amd64
  
  Server:
   Version:         1.13.1
   API version:     1.26 (minimum version 1.12)
   Package version: docker-1.13.1-206.git7d71120.el7_9.x86_64
   Go version:      go1.10.3
   Git commit:      7d71120/1.13.1
   Built:           Wed May 19 02:56:06 2021
   OS/Arch:         linux/amd64
   Experimental:    false
  </code></pre>
  <p>VS what I see on Docker website:</p>
  <pre><code>Client:
   Version:           19.03.8
   API version:       1.40
   Go version:        go1.12.17
   Git commit:        afacb8b
   Built:             Wed Mar 11 01:21:11 2020
   OS/Arch:           darwin/amd64
   Context:           default
   Experimental:      true
  
  Server:
   Engine:
    Version:          19.03.8
    API version:      1.40 (minimum version 1.12)
    Go version:       go1.12.17
    Git commit:       afacb8b
    Built:            Wed Mar 11 01:29:16 2020
    OS/Arch:          linux/amd64
    Experimental:     true
   containerd:
    Version:          v1.2.13
    GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
   runc:
    Version:          1.0.0-rc10
    GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
   docker-init:
    Version:          0.18.0
    GitCommit:        fec3683
  </code></pre>