# Unable to \`docker build\` an image \`FROM cimg/base:current-22.04\`

**URL:** <https://discuss.circleci.com/t/unable-to-docker-build-an-image-from-cimg-base-current-22-04/44162>\
**Category:** Build Environment\
**Tags:** remote-docker\
**Created:** [May 23, 2022, 4:08pm UTC](https://discuss.circleci.com/t/unable-to-docker-build-an-image-from-cimg-base-current-22-04/44162 "2022-05-23T16:08:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mavenlink-jb](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mavenlink-jb](https://discuss.circleci.com/u/mavenlink-jb)\
**Post date:** [May 23, 2022, 4:08pm UTC](https://discuss.circleci.com/t/unable-to-docker-build-an-image-from-cimg-base-current-22-04/44162/1 "2022-05-23T16:08:31Z")

</div>

Hello,

I am receiving this error when attempting to `docker build` an image in circleci that is `FROM cimg/base:current-22.04`

```auto
# this is the debug output from a shell script I have set in the `Dockerfile`

+ whoami
circleci
apt-get update
+ echo apt-get update
+ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 https://download.docker.com/linux/ubuntu jammy InRelease [48.9 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Err:2 https://download.docker.com/linux/ubuntu jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
Err:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:4 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease [23.8 kB]
Err:4 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [109 kB]
Err:3 http://archive.ubuntu.com/ubuntu jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
Err:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Reading package lists...
W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/git-core-ubuntu-ppa.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: https://download.docker.com/linux/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
E: The repository 'https://download.docker.com/linux/ubuntu jammy InRelease' is not signed.
W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/git-core-ubuntu-ppa.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
W: https://ppa.launchpadcontent.net/git-core/ppa/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/git-core-ubuntu-ppa.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: https://ppa.launchpadcontent.net/git-core/ppa/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: https://ppa.launchpadcontent.net/git-core/ppa/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24
E: The repository 'https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/git-core-ubuntu-ppa.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/git-core-ubuntu-ppa.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/git-core-ubuntu-ppa.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed.
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
The command '/bin/bash -exo pipefail -c bash /var/tmp/bootstrap.sh' returned a non-zero code: 100

```

---

<div class="post-metadata">

**Author:** ![aaronclark](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/aaronclark/32/31078_2.png) [@aaronclark](https://discuss.circleci.com/u/aaronclark)\
**Post date:** [May 24, 2022, 1:40am UTC](https://discuss.circleci.com/t/unable-to-docker-build-an-image-from-cimg-base-current-22-04/44162/2 "2022-05-24T01:40:47Z")

</div>

Hi @mavenlink-jb,

Sorry to hear you are running into this issue. Please take a look at the following support article, and let me know if you are able to resolve the issue by upgrading the version of the machine image:

> [https://support.circleci.com/hc/en-us/articles/6025804632987](https://support.circleci.com/hc/en-us/articles/6025804632987)

---

<div class="post-metadata">

**Author:** ![pbiggar](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pbiggar/32/30342_2.png) [@pbiggar](https://discuss.circleci.com/u/pbiggar)\
**Post date:** [June 9, 2022, 3:27am UTC](https://discuss.circleci.com/t/unable-to-docker-build-an-image-from-cimg-base-current-22-04/44162/3 "2022-06-09T03:27:39Z")

</div>

The second error here:

```auto
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'

```

Is apparently due to an old version of docker: [docker - Why I cannot run `apt update` inside a fresh ubuntu:22.04? - Stack Overflow](https://stackoverflow.com/a/72057185/104021), which is fixed on 22:04. So this would do it:

```auto
version: 2.1
jobs:
  build:
    machine:
      image: ubuntu-2204:current # NOTE 2204, not 2004

```
