-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't build image #12
Comments
I haven't finished the chapter yet, but I modified the Dockerfile and it helped me to pass the first test (docker run -v /var/run/docker.sock:/var/run/docker.sock identijenk sudo docker ps): FROM jenkins:2.60.3 RUN apt-get update |
I've ended the chapter with this Dockerfile: FROM jenkins/jenkins:lts
USER root
RUN apt-get update \
&& apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
sudo \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker-ce \
&& rm -rf /var/lib/apt/lists/*
RUN curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose; chmod +x /usr/local/bin/docker-compose
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers
USER jenkins
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt |
The in the book described way to install plugins is deprecated. FROM jenkins/jenkins:lts
USER root
RUN apt-get update \
&& apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
sudo \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker-ce \
&& rm -rf /var/lib/apt/lists/*
RUN curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose; chmod +x /usr/local/bin/docker-compose
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers
USER jenkins
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN jenkins-plugin-cli -f /usr/share/jenkins/plugins.txt Documenting it in this issue for others who encounter this problem ;) |
An alternative to use a similar jenkins image like in the book. FROM jenkins:1.651.3-alpine
ENV JENKINS_UC_DOWNLOAD 'http://ftp-nyc.osuosl.org/pub/jenkins'
USER root
RUN apk update
RUN apk add curl \
openssl \
ca-certificates \
docker
RUN apk add --no-cache gnupg \
&& apk add --no-cache unzip \
&& apk add sudo \
&& apk add libltdl
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers.d/jenkins \
&& chmod 0440 /etc/sudoers.d/jenkins \
&& echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers \
&& rm -rf /var/lib/apt/lists/*
RUN sudo curl -L https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
RUN sudo chmod +x /usr/local/bin/docker-compose \
&& sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
USER jenkins
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt jenkins.yml services:
identidock:
build: .
expose:
- "9090"
environment:
ENV: PROD
links:
- dnmonster
- redis
dnmonster:
image: amouat/dnmonster:1.0
redis:
image: redis:3.0 |
Actual for me jenkins_shell:
|
cmd :
docker build -t identijenk .
ouput:
Sending build context to Docker daemon 2.56kB
Step 1/8 : FROM jenkins:1.609.3
---> 60d2fc1c3854
Step 2/8 : USER root
---> Using cache
---> 58d5549c8a56
Step 3/8 : RUN echo "deb http://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list && apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && apt-get update && apt-get install -y apt-transport-https && apt-get install -y sudo && apt-get install -y docker-engine && rm -rf /var/lib/apt/lists/*
---> Running in 15793fbb78f2
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.9vhhqM49cT --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://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
gpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net
gpg: key 2C52609D: public key "Docker Release Tool (releasedocker) [email protected]" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Ign http://httpredir.debian.org jessie InRelease
Get:1 http://apt.dockerproject.org debian-jessie InRelease [48.7 kB]
Get:2 http://httpredir.debian.org jessie-updates InRelease [16.3 kB]
Ign http://httpredir.debian.org jessie-backports InRelease
Get:3 http://httpredir.debian.org jessie Release.gpg [1652 B]
Ign http://httpredir.debian.org jessie-backports Release.gpg
Get:4 http://httpredir.debian.org jessie Release [77.3 kB]
Get:5 http://security.debian.org jessie/updates InRelease [44.9 kB]
Get:6 http://httpredir.debian.org jessie-updates/main amd64 Packages [20 B]
Ign http://httpredir.debian.org jessie-backports Release
Get:7 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB]
Get:8 http://apt.dockerproject.org debian-jessie/main amd64 Packages [7366 B]
Get:9 http://security.debian.org jessie/updates/main amd64 Packages [922 kB]
Err http://httpredir.debian.org jessie-backports/main amd64 Packages
Err http://httpredir.debian.org jessie-backports/main amd64 Packages
Err http://httpredir.debian.org jessie-backports/main amd64 Packages
Err http://httpredir.debian.org jessie-backports/main amd64 Packages
404 Not Found
Fetched 10.2 MB in 8s (1266 kB/s)
W: There is no public key available for the following key IDs:
AA8E81B4331F7F50
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c echo "deb http://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list && apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && apt-get update && apt-get install -y apt-transport-https && apt-get install -y sudo && apt-get install -y docker-engine && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
The text was updated successfully, but these errors were encountered: