0

I am not able to run the following command in the dockerfile.

RUN apt-get update && \
    apt-get -y install curl && \
    curl http://nginx.org/keys/nginx_signing.key | apt-key add - && \
    apt-get update && \
    apt-get -y install build-essential libpq-dev nginx supervisor && \
    rm -rf /var/lib/apt/lists/*

I get an error like this...

Err:5 http://nginx.org/packages/debian jessie InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
Reading package lists...
W: GPG error: http://nginx.org/packages/debian jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
E: The repository 'http://nginx.org/packages/debian jessie InRelease' is not signed.
The command '/bin/sh -c apt-get update &&     apt-get -y install curl &&     curl http://nginx.org/keys/nginx_signing.key | apt-key add - &&     apt-get update &&     apt-get -y install build-essential libpq-dev nginx supervisor &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

I need to build the docker image in order to run the compose file that I found here...

https://github.com/yoanisgil/easygeoip

3
  • what is your base image ? Commented Aug 30, 2019 at 6:36
  • python:2.7-slim Commented Aug 30, 2019 at 6:39
  • 1
    This may help. There are some issues piping the output of wget or curl to apt-key Commented Aug 30, 2019 at 6:45

1 Answer 1

1

use this instead

FROM python:2.7-slim
RUN apt-get update && \
    apt-get -y install wget gnupg && \
    wget https://nginx.org/keys/nginx_signing.key && \
    cat nginx_signing.key | apt-key add - && \
    apt-get update && \
    apt-get -y install build-essential libpq-dev nginx supervisor && \
    rm -rf /var/lib/apt/lists/* 

I think your curl did not produced the correct file

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.