From: Fotis Xenakis <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

docker: update default distros

Signed-off-by: Fotis Xenakis <[email protected]>
Message-Id: 
<vi1pr03mb43837c53ceece1f8722996f5a6...@vi1pr03mb4383.eurprd03.prod.outlook.com>

---
diff --git a/docker/Dockerfile.builder b/docker/Dockerfile.builder
--- a/docker/Dockerfile.builder
+++ b/docker/Dockerfile.builder
@@ -8,7 +8,7 @@
 # This Docker file defines a container intended to build, test and publish
 # OSv kernel as well as many applications ...
 #
-ARG DIST="fedora-29"
+ARG DIST="fedora-31"
 FROM osvunikernel/osv-${DIST}-builder-base
 
 #
@@ -33,8 +33,8 @@ CMD /bin/bash
 #
 # NOTES
 #
-# Build the container based on default Fedora 29 base image:
-# docker build -t osv/builder-fedora-29 -f Dockerfile.builder .
+# Build the container based on default Fedora 31 base image:
+# docker build -t osv/builder-fedora-31 -f Dockerfile.builder .
 #
 # Build the container based of specific Ubuntu version
 # docker build -t osv/builder-ubuntu-19.10 -f Dockerfile.builder --build-arg 
DIST="ubuntu-19.10" .
@@ -43,8 +43,8 @@ CMD /bin/bash
 # docker build -t osv/builder-fedora-31 -f Dockerfile.builder --build-arg 
DIST="fedora-31" --build-arg GIT_ORG_OR_USER=a_user .
 #
 # Run the container FIRST time example:
-# docker run -it --privileged osv/builder-fedora-29
-# 
+# docker run -it --privileged osv/builder-fedora-31
+#
 # To restart:
 # docker restart ID (from docker ps -a) && docker attach ID
 #
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
@@ -7,7 +7,7 @@
 # This Docker file defines an image based on Ubuntu distribution and provides
 # all packages necessary to build and run kernel and applications.
 #
-ARG DIST_VERSION=29
+ARG DIST_VERSION=31
 FROM fedora:${DIST_VERSION}
 
 RUN yum install -y git python3 file which
@@ -17,20 +17,20 @@ RUN yum install -y git python3 file which
 #
 
 # - prepare directories
-RUN mkdir /git-repos
+RUN mkdir -p /osv/scripts
 
-# - clone OSv just to get setup.py
-WORKDIR /git-repos
+# - get setup.py
 ARG GIT_ORG_OR_USER=cloudius-systems
-RUN git clone --depth 1 -b master --single-branch 
https://github.com/${GIT_ORG_OR_USER}/osv.git
-WORKDIR /git-repos/osv
+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/
 
-# - install all required packages and remove OSv git repo
-RUN scripts/setup.py
-RUN rm -rf /git-repos
+# - install all required packages and remove scripts
+RUN python3 /osv/scripts/setup.py && rm -rf /osv/scripts
 
 # - 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
 
+WORKDIR /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
@@ -7,7 +7,7 @@
 # This Docker file defines an image based on Ubuntu distribution and provides
 # all packages necessary to build and run kernel and applications.
 #
-ARG DIST_VERSION=19.04
+ARG DIST_VERSION=19.10
 FROM ubuntu:${DIST_VERSION}
 
 ENV DEBIAN_FRONTEND noninteractive
@@ -23,22 +23,22 @@ RUN apt-get update -y && apt-get install -y git python3
 #
 
 # - prepare directories
-RUN mkdir /git-repos
+RUN mkdir -p /osv/scripts
 
-# - clone OSv
-WORKDIR /git-repos
+# - get setup.py
 ARG GIT_ORG_OR_USER=cloudius-systems
-RUN git clone --depth 1 -b master --single-branch 
https://github.com/${GIT_ORG_OR_USER}/osv.git
-WORKDIR /git-repos/osv
+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/
 
-# - install all required packages and delete OSv repo
-RUN scripts/setup.py
-RUN rm -rf /git-repos
+# - install all required packages and remove scripts
+RUN python3 /osv/scripts/setup.py && rm -rf /osv/scripts
 
 RUN update-alternatives --set java 
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
 
 # - 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/
 RUN chmod u+x /usr/local/bin/capstan
 
+WORKDIR /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
@@ -8,7 +8,7 @@
 # This Docker file defines a container intended to run and test OSv
 # It comes with capstan that can pull kernel and pre-built MPM packages
 #
-ARG DIST_VERSION=29
+ARG DIST_VERSION=31
 FROM fedora:${DIST_VERSION}
 
 RUN yum install -y \
diff --git a/docker/Dockerfile.runner-ubuntu b/docker/Dockerfile.runner-ubuntu
--- a/docker/Dockerfile.runner-ubuntu
+++ b/docker/Dockerfile.runner-ubuntu
@@ -8,7 +8,7 @@
 # This Docker file defines a container intended to run and test OSv
 # It comes with capstan that can pull kernel and pre-built MPM packages
 #
-ARG DIST_VERSION=19.04
+ARG DIST_VERSION=19.10
 FROM ubuntu:${DIST_VERSION}
 
 ENV DEBIAN_FRONTEND noninteractive
@@ -26,7 +26,7 @@ qemu-system-x86 \
 qemu-utils
 
 # - prepare directories
-RUN mkdir /git-repos /result
+RUN mkdir /git-repos
 
 # - clone OSv
 WORKDIR /git-repos
@@ -51,7 +51,7 @@ CMD /bin/bash
 #
 # Run the container FIRST time example:
 # docker run -it --privileged osv/runner-ubuntu
-# 
+#
 # To restart:
 # docker restart ID (from docker ps -a) && docker attach ID
 #
diff --git a/docker/README.md b/docker/README.md
--- a/docker/README.md
+++ b/docker/README.md
@@ -2,14 +2,14 @@
 Docker files intended to help setup OSv build environment.
 There are two versions of it - one based on Ubuntu and another on Fedora.
 
-Build container image
+Build container image (default, based on Fedora)
 ```
-docker build -t osv/builder-ubuntu -f Dockerfile.builder-ubuntu . # Use 
specific docker file
+docker build -t osv/builder -f Dockerfile.builder .
 ```
 
 Build container image for specific version of linux distribution and git repo 
owner (if forker)
 ```
-docker build -t osv/builder-fedora-31 -f Dockerfile.builder-fedora --build-arg 
DIST_VERSION=31 --build-arg GIT_ORG_OR_USER=a_user .
+docker build -t osv/builder-ubuntu-19.10 -f Dockerfile.builder --build-arg 
DIST="ubuntu-19.10" --build-arg GIT_ORG_OR_USER=a_user .
 ```
 
 Run container
@@ -41,8 +41,9 @@ git pull
 
 To update Fedora/Ubuntu packages run this in /git-repos/osv directory:
 ```bash
-./script/setup.py
+./scripts/setup.py
 ```
+
 # Docker OSv runner
 Docker files intended to help setup OSv environment to run and test OSv.
 There are two versions of it - one based on Ubuntu and another on Fedora.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000b08f5705a486506e%40google.com.

Reply via email to