From: Waldemar Kozaczuk <jwkozac...@gmail.com>
Committer: Waldemar Kozaczuk <jwkozac...@gmail.com>
Branch: master

docker: refine build docker files

Based on the original patch sent by Fotis Xenakis:

"Changes since v1:
- Don't create redundant /osv directory in builder dockerfiles.
- Remove dependency on wget in runner dockerfiles."

Signed-off-by: Fotis Xenakis <fo...@windowslive.com>
Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>

---
diff --git a/docker/Dockerfile.builder-fedora-base 
b/docker/Dockerfile.builder-fedora-base
--- a/docker/Dockerfile.builder-fedora-base
+++ b/docker/Dockerfile.builder-fedora-base
@@ -17,20 +17,20 @@ RUN yum install -y git python3 file which
 #
 
 # - prepare directories
-RUN mkdir -p /osv/scripts
+RUN mkdir -p /git-repos/osv/scripts
 
 # - get setup.py
 ARG GIT_ORG_OR_USER=cloudius-systems
 ARG GIT_BRANCH=master
-ADD 
https://raw.githubusercontent.com/${GIT_ORG_OR_USER}/osv/${GIT_BRANCH}/scripts/linux_distro.py
 /osv/scripts/
-ADD 
https://raw.githubusercontent.com/${GIT_ORG_OR_USER}/osv/${GIT_BRANCH}/scripts/setup.py
 /osv/scripts/
+ADD 
https://raw.githubusercontent.com/${GIT_ORG_OR_USER}/osv/${GIT_BRANCH}/scripts/linux_distro.py
 /git-repos/osv/scripts/
+ADD 
https://raw.githubusercontent.com/${GIT_ORG_OR_USER}/osv/${GIT_BRANCH}/scripts/setup.py
 /git-repos/osv/scripts/
 
 # - install all required packages and remove scripts
-RUN python3 /osv/scripts/setup.py && rm -rf /osv/scripts
+RUN python3 /git-repos/osv/scripts/setup.py && rm -rf /git-repos/osv/scripts
 
 # - install Capstan
 ADD 
https://github.com/cloudius-systems/capstan/releases/latest/download/capstan 
/usr/local/bin/capstan
 RUN chmod u+x /usr/local/bin/capstan
 
-WORKDIR /osv
+WORKDIR /git-repos/osv
 CMD /bin/bash
diff --git a/docker/Dockerfile.builder-ubuntu-base 
b/docker/Dockerfile.builder-ubuntu-base
--- a/docker/Dockerfile.builder-ubuntu-base
+++ b/docker/Dockerfile.builder-ubuntu-base
@@ -23,22 +23,22 @@ RUN apt-get update -y && apt-get install -y git python3
 #
 
 # - prepare directories
-RUN mkdir -p /osv/scripts
+RUN mkdir -p /git-repos/osv/scripts
 
 # - get setup.py
 ARG GIT_ORG_OR_USER=cloudius-systems
 ARG GIT_BRANCH=master
-ADD 
https://raw.githubusercontent.com/${GIT_ORG_OR_USER}/osv/${GIT_BRANCH}/scripts/linux_distro.py
 /osv/scripts/
-ADD 
https://raw.githubusercontent.com/${GIT_ORG_OR_USER}/osv/${GIT_BRANCH}/scripts/setup.py
 /osv/scripts/
+ADD 
https://raw.githubusercontent.com/${GIT_ORG_OR_USER}/osv/${GIT_BRANCH}/scripts/linux_distro.py
 /git-repos/osv/scripts/
+ADD 
https://raw.githubusercontent.com/${GIT_ORG_OR_USER}/osv/${GIT_BRANCH}/scripts/setup.py
 /git-repos/osv/scripts/
 
 # - install all required packages and remove scripts
-RUN python3 /osv/scripts/setup.py && rm -rf /osv/scripts
+RUN python3 /git-repos/osv/scripts/setup.py && rm -rf /git-repos/osv/scripts
 
 RUN update-alternatives --set java 
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
 
 # - install Capstan
 ADD 
https://github.com/cloudius-systems/capstan/releases/latest/download/capstan 
/usr/local/bin/
 RUN chmod u+x /usr/local/bin/capstan
 
-WORKDIR /osv
+WORKDIR /git-repos/osv
 CMD /bin/bash
diff --git a/docker/Dockerfile.runner-fedora b/docker/Dockerfile.runner-fedora
--- a/docker/Dockerfile.runner-fedora
+++ b/docker/Dockerfile.runner-fedora
@@ -17,7 +17,6 @@ python3 \
 file \
 which \
 curl \
-wget \
 qemu-system-x86 \
 qemu-img
 
@@ -31,7 +30,7 @@ ARG GIT_BRANCH=master
 RUN git clone --depth 1 -b ${GIT_BRANCH} --single-branch 
https://github.com/${GIT_ORG_OR_USER}/osv.git
 
 # - install Capstan
-RUN wget 
https://github.com/cloudius-systems/capstan/releases/latest/download/capstan -O 
/usr/local/bin/capstan
+ADD 
https://github.com/cloudius-systems/capstan/releases/latest/download/capstan 
/usr/local/bin/capstan
 RUN chmod u+x /usr/local/bin/capstan
 
 CMD /bin/bash
diff --git a/docker/Dockerfile.runner-ubuntu b/docker/Dockerfile.runner-ubuntu
--- a/docker/Dockerfile.runner-ubuntu
+++ b/docker/Dockerfile.runner-ubuntu
@@ -21,7 +21,6 @@ RUN apt-get update -y && apt-get install -y \
 git \
 python3 \
 curl \
-wget \
 qemu-system-x86 \
 qemu-utils
 
@@ -35,7 +34,7 @@ ARG GIT_BRANCH=master
 RUN git clone --depth 1 -b ${GIT_BRANCH} --single-branch 
https://github.com/${GIT_ORG_OR_USER}/osv.git
 
 # - install Capstan
-RUN wget 
https://github.com/cloudius-systems/capstan/releases/latest/download/capstan -O 
/usr/local/bin/capstan
+ADD 
https://github.com/cloudius-systems/capstan/releases/latest/download/capstan 
/usr/local/bin/capstan
 RUN chmod u+x /usr/local/bin/capstan
 
 CMD /bin/bash

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000d00b2f05a48927c7%40google.com.

Reply via email to