Search code examples
dockerubuntuapt-get

Unable to run apt-get within docker build


I have an Dockerfile that's installing ffmpeg and for some reason i get error that says no pub key.

FROM dorowu/ubuntu-desktop-lxde-vnc

WORKDIR /data

RUN apt-get update && apt-get install -y \
    ffmpeg 

This is the error I get:

#0 13.99 W: GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B #0 13.99 E: The repository 'http://dl.google.com/linux/chrome/deb stable InRelease' is not signed.

I have tried to add this key by running this command with the key I get but nothing is changed and the error remain.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B

OS: Ubuntu 22.04 LTS

Thanks!


Solution

  • You are missing GPG public key for the Google Chrome repository and apt-get cant verify the package.

    Lets add it:

    FROM dorowu/ubuntu-desktop-lxde-vnc
    
    WORKDIR /data
    
    # Add the missing GPG key
    RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
    
    # Install ffmpeg
    RUN apt-get update && apt-get install -y \
        ffmpeg