Korzystanie z okna dokowanego w wersji 1.9.0
Mam kontener dokera zapewniający lustrzane ubuntu trusty (wierne-mirror). Próbuję zbudować drugi kontener i chcę, aby aktualizował i instalował pakiety z wiernego-mirror.
Mój plik dokujący dla drugiego kontenera ma;
FROM ubuntu:14.04
RUN sed -i -e s#http://archive.ubuntu.com#${MIRROR}#g \
-e s#http://security.ubuntu.com#${MIRROR}#g \
/etc/apt/sources.list
RUN cat /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y autoremove
Przekazuję informacje MIRROR do budowy dokera za pomocą opcja --build-arg , tak;
ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' trusty-mirror 2>/dev/null)
docker build --build-arg MIRROR=ftp://$ip
Kiedy to działa;
+++ docker inspect --format '{{ .NetworkSettings.IPAddress }}' trusty-mirror
++ ip=172.17.0.2
++ docker build --build-arg MIRROR=ftp://172.17.0.2 .
Sending build context to Docker daemon 8.192 kB
Step 1 : FROM ubuntu:14.04
---> e9ae3c220b23
Step 2 : RUN sed -i -e s#http://archive.ubuntu.com#${MIRROR}#g -e s#http://security.ubuntu.com#${MIRROR}#g /etc/apt/sources.list
---> Using cache
---> 76f727c60ef8
Step 3 : RUN cat /etc/apt/sources.list
---> Running in 55ff5ff46467
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb /ubuntu/ trusty main restricted
deb-src /ubuntu/ trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb /ubuntu/ trusty-updates main restricted
deb-src /ubuntu/ trusty-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb /ubuntu/ trusty universe
deb-src /ubuntu/ trusty universe
deb /ubuntu/ trusty-updates universe
deb-src /ubuntu/ trusty-updates universe
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb /ubuntu/ trusty-backports main restricted
# deb-src /ubuntu/ trusty-backports main restricted
deb /ubuntu/ trusty-security main restricted
deb-src /ubuntu/ trusty-security main restricted
deb /ubuntu/ trusty-security universe
deb-src /ubuntu/ trusty-security universe
# deb /ubuntu/ trusty-security multiverse
# deb-src /ubuntu/ trusty-security multiverse
---> b296354b0b9e
Removing intermediate container 55ff5ff46467
Step 5 : RUN apt-get update
---> Running in 7251e0ffb6d2
E: Malformed line 4 in source list /etc/apt/sources.list (URI parse)
E: The list of sources could not be read.
Zauważ, że build-arg MIRROR rozwija się do „”, co powoduje uszkodzenie pliku / etc / apt sources.list i powoduje niepowodzenie aktualizacji.
Podwójnie sprawdziłem plik Docker, używając zakodowanej wartości w pliku Docker;
ENV MIRROR=ftp://172.17.0.2
i wszystko działa zgodnie z oczekiwaniami, Z WYJĄTKIEM budowania dokera zawiedzie;
One or more build-args [MIRROR] were not consumed, failing build.
Czego mi tu brakuje?