使用Dockerfile构建映像的问题

时间:2017-11-22 16:58:37

标签: docker dockerfile

使用 dockerfile 构建图片时遇到问题。

dockerfile

FROM node:4.4

MAINTAINER paas  

ENV NGINX_VERSION 1.11.6-1~jessie

RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \

&& echo "deb nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list \

&& apt-get update \

&& apt-get install --no-install-recommends --no-install-suggests -y \

ca-certificates \

nginx=${NGINX_VERSION} \

nginx-module-xslt \

nginx-module-geoip \

nginx-module-image-filter \

nginx-module-perl \

nginx-module-njs \

gettext-base \

curl \

&& rm -rf /var/lib/apt/lists/*

RUN mkdir /etc/nginx/sites-enabled


# SSL Certificate Installation

ADD star_dar_kz.key /etc/ssl/

# ADD star_dar_kz.pem /etc/ssl/
# ADD dhparam.pem /etc/ssl/

# ADD nginx.conf /etc/nginx/
# ADD merchants.dar.kz.conf /etc/nginx/sites-enabled

COPY . /app

WORKDIR /app

RUN npm install --global gulp-cli

RUN npm install --global bower

RUN npm install

RUN bower --allow-root install

RUN gulp build --env prod

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]

docker build之后,GPG行显示为红色,图像创建失败。为什么呢?

Sending build context to Docker daemon  3.072kB
Step 1/16 : FROM node:4.4
 ---> 93b396996a16
Step 2/16 : MAINTAINER Nurbek Sadykov
 ---> Using cache
 ---> e9a0bc967863
Step 3/16 : ENV NGINX_VERSION 1.11.6-1~jessie
 ---> Using cache
 ---> 3e87467bd365
Step 4/16 : RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62     && echo "deb h:/nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list     && apt-get update     && apt-get install --no-install-recommends --no-install-suggests -y                         ca-certificates                         nginx=${NGINX_VERSION}                         nginx-module-xslt                         nginx-module-geoip                         nginx-module-image-filter                         nginx-module-perl                         nginx-module-njs                         gettext-base                                                 curl     && rm -rf /var/lib/apt/lists/*
 ---> Running in 93f88784bc24
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.acoVZ86x3m --no-auto-check-trustdb --trust-model always --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
**gpg: requesting key 7BD9BF62 from hkp server pgp.mit.edu**
**gpg: key 7BD9BF62: public key "nginx signing key " imported**
**gpg: Total number processed: 1**
**gpg:               imported: 1  (RSA: 1)** - ** THIS IS INDICATED IN RED COLOR**
Get:1 url InRelease [63.1 kB]
Get:2 url InRelease [2865 B]
Ign url jessie InRelease
Get:3 url jessie-updates InRelease [145 kB]
Get:4 url amd64 Packages [37.3 kB]
Get:5 url jessie Release.gpg [2373 B]
Get:6 urljessie Release [148 kB]
Get:7 url amd64 Packages [613 kB]
Get:8 url amd64 Packages [23.2 kB]
Get:9 url jessie/main amd64 Packages [9063 kB]
Fetched 10.1 MB in 5s (1835 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
**Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
 distribution that some required packages have not yet been created
or been moved out of Incoming**.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nginx-module-geoip : Depends: nginx (= 1.13.7-1~jessie)
 nginx-module-image-filter : Depends: nginx (= 1.13.7-1~jessie)
 nginx-module-njs : Depends: nginx (= 1.13.7-1~jessie)
 nginx-module-perl : Depends: nginx (= 1.13.7-1~jessie)
 nginx-module-xslt : Depends: nginx (= 1.13.7-1~jessie)
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62     && echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list     && apt-get update     && apt-get install --no-install-recommends --no-install-suggests -y                         ca-certificates                         nginx=${NGINX_VERSION}                         nginx-module-xslt                         nginx-module-geoip                         nginx-module-image-filter                         nginx-module-perl                         nginx-module-njs                         gettext-base                                                 curl     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

0 个答案:

没有答案