Shyam Bhimani
Shyam Bhimani

Reputation: 1270

E: The repository 'http://archive.ubuntu.com/ubuntu precise Release' is not signed

I am trying to set up Scrapy docker env on my local by running this command

docker build -t scrapy .

I am getting below error

Get:20 http://archive.ubuntu.com/ubuntu precise Release [49.6 kB] Get:21 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [2975 B] Get:22 http://archive.ubuntu.com/ubuntu precise Release.gpg [198 B] Ign:22 http://archive.ubuntu.com/ubuntu precise Release.gpg Reading package lists...
W: GPG error: http://archive.ubuntu.com/ubuntu precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 E: The repository 'http://archive.ubuntu.com/ubuntu precise Release' is not signed. The command '/bin/sh -c apt-get update' returned a non-zero code: 100

My Docker file looks like this

############################################################
# Dockerfile for a Scrapy development environment
# Based on Ubuntu Image
############################################################

FROM ubuntu
MAINTAINER NeuralFoundry <neuralfoundry.com>

RUN echo deb http://archive.ubuntu.com/ubuntu precise universe >> /etc/apt/sources.list
RUN apt-get update

## Python Family
RUN apt-get install -qy python python-dev python-distribute python-pip ipython

## Selenium 
RUN apt-get install -qy firefox xvfb 
RUN pip install selenium pyvirtualdisplay

## AWS Python SDK
RUN pip install boto3

## Scraping
RUN pip install beautifulsoup4 requests 
RUN apt-get install -qy libffi-dev libxml2-dev libxslt-dev lib32z1-dev libssl-dev

## Scrapy
RUN pip install lxml scrapy scrapyjs

Any help would be appreciated. TIA

Upvotes: 5

Views: 4538

Answers (1)

mkasberg
mkasberg

Reputation: 17292

Your Dockerfile has an unqualified reference to FROM ubuntu. That will resolve to ubuntu:latest, which is currently the same as ubuntu:18.04. Ubuntu 18.04 is codenamed Bionic Beaver. Precise Penguin was 12.04. You're trying to point to a Precise Penguin repository from your Bionic Beaver ubuntu installation: RUN echo deb http://archive.ubuntu.com/ubuntu precise universe >> /etc/apt/sources.list.

It's breaking, presumably, because Ubuntu 18.04 doesn't have a key to verify the signature of the 12.04 repository. You should be consistent with your version throughout the image. Unfortunately, the oldest Docker image available looks like it's 14.04 (trusty). Is there a reason you wanted the precise repository specifically, or could you use a more modern version? Nothing jumps out at me from your Dockerfile as something that would break in 18.04. Pick the version you want and fix your FROM line to be FROM ubuntu:14.04 (or higher). Then remove that RUN echo deb ... line (assuming you don't acutally need the precise repository).

Upvotes: 4

Related Questions