Merge "Improving centos mirror Dockerfile"

This commit is contained in:
Zuul 2018-06-22 14:19:46 +00:00 committed by Gerrit Code Review
commit 9bf1abe1e8
3 changed files with 19 additions and 8 deletions

2
.gitignore vendored
View File

@ -3,3 +3,5 @@
.tox
localrc
toCOPY/.gitconfig
centos-mirror-tools/logs/
centos-mirror-tools/output/

View File

@ -2,21 +2,24 @@
FROM centos:7.4.1708
WORKDIR /localdisk
#ENV http_proxy "http://your.actual_http_proxy.com:your_port"
#ENV https_proxy "https://your.actual_https_proxy.com:your_port"
#ENV ftp_proxy "http://your.actual_ftp_proxy.com:your_port"
#RUN echo "proxy=http://your-proxy.com:port" >> /etc/yum.conf
#RUN echo "proxy=$http_proxy" >> /etc/yum.conf && \
# echo -e "export http_proxy=$http_proxy\nexport https_proxy=$https_proxy\n\
#export ftp_proxy=$ftp_proxy" >> /root/.bashrc
RUN yum install -y epel-release sudo vim-enhanced net-tools
RUN yum install -y /usr/bin/yumdownloader rpm-build rpm-sign deltarpm wget bind bind-utils
RUN rm /etc/yum.repos.d/CentOS-Sources.repo && \
rm /etc/yum.repos.d/epel.repo
RUN yum install -y epel-release sudo vim-enhanced net-tools \
/usr/bin/yumdownloader rpm-build rpm-sign deltarpm wget bind \
bind-utils && rm /etc/yum.repos.d/CentOS-Sources.repo \
/etc/yum.repos.d/epel.repo
COPY StarlingX.repo /etc/yum.repos.d
COPY rpm-gpg-keys/* /etc/pki/rpm-gpg/
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
WORKDIR /localdisk
ENTRYPOINT ["/bin/bash"]

View File

@ -14,7 +14,13 @@ $ docker build -t <your_docker_image_name>:<your_image_version> -f Dockerfile .
The container shall be run from the same directory where the other scripts are stored.
```
$ docker run -it -v $(pwd):/localdisk <your_docker_image_name>:<your_image_version> bash
$ docker run -it -v $(pwd):/localdisk <your_docker_image_name>:<your_image_version>
```
The container can also be run the following way, so the `download_mirror.sh` runs automatically without having to enter the container and the step 2can be simplified.
```
$ docker run -it -v $(pwd):/localdisk <your_docker_image_name>:<your_image_version> download_mirror.sh
```
As `/localdisk` is defined as the workdir of the container, the same folder name should be used to define the volume. The container will start to run and populate a `logs` and `output` folders in this directory.