Skip to content

Instantly share code, notes, and snippets.

@rafarocha
Last active May 20, 2016 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafarocha/95442c0e6243b159a1d21738c6499ac0 to your computer and use it in GitHub Desktop.
Save rafarocha/95442c0e6243b159a1d21738c6499ac0 to your computer and use it in GitHub Desktop.
docker build problem apt-get update

Problema

  • Não consigo fazer um build de um Dockerfile por conta do apt-get update, mesmo configurando o proxy
  • Proxy local configurado e arquivo /etc/default/docker

Realizar os seguintes passos

  1. git clone https://github.com/camptocamp/docker-puppet-agent.git
  2. cd docker-puppet-agent
  3. docker build -t puppet-agent .

Log de erro:

Step 8 : RUN apt-get -qq update
 ---> Running in d9d4f2db1a9f
W: Failed to fetch http://br.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Could not resolve 'br.archive.ubuntu.com'
W: Failed to fetch http://br.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Could not resolve 'br.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Could not resolve 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
 ---> a4882292c36f
Removing intermediate container d9d4f2db1a9f
Step 9 : RUN apt-get -qq -y install curl
 ---> Running in 08c1ce85f403
E: Unable to locate package curl
The command '/bin/sh -c apt-get -qq -y install curl' returned a non-zero code: 100

O conteúdo do Dockerfile que ajustei para tentar sanar o problema, mas sem sucesso


FROM ubuntu:trusty
MAINTAINER mickael.canevet@camptocamp.com

# testar
# apt-add-repository ppa:ondrej/php

RUN dpkg --add-architecture amd64
ADD sources.list /etc/apt/sources.list
ENV RELEASE=trusty
ENV PUPPET_AGENT_VERSION 1.3.0-1${RELEASE}
ENV PATH=/opt/puppetlabs/bin:$PATH

RUN apt-get -qq update 
RUN apt-get -qq -y install curl 
RUN curl -O http://apt.puppetlabs.com/puppetlabs-release-pc1-${RELEASE}.deb 
RUN dpkg -i puppetlabs-release-pc1-${RELEASE}.deb 
RUN rm -rf /var/lib/apt/lists/*

ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8

RUN apt-get update \
  && apt-get install -y puppet-agent=$PUPPET_AGENT_VERSION \
  && rm -rf /var/lib/apt/lists/*

arquivo /etc/default/docker

# Docker Upstart and SysVinit configuration file

# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"

# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

# If you need Docker to use an HTTP proxy, it can also be specified here.
export http_proxy="http://127.0.0.1:5865/"

# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment