Changes since v1: - Don't create redundant /osv directory in builder dockerfiles. - Remove dependency on wget in runner dockerfiles.
Signed-off-by: Fotis Xenakis <[email protected]> --- docker/Dockerfile.builder | 10 +++++----- docker/Dockerfile.builder-fedora-base | 20 ++++++++++---------- docker/Dockerfile.builder-ubuntu-base | 20 ++++++++++---------- docker/Dockerfile.runner-fedora | 5 ++--- docker/Dockerfile.runner-ubuntu | 9 ++++----- docker/README.md | 9 +++++---- 6 files changed, 36 insertions(+), 37 deletions(-) diff --git a/docker/Dockerfile.builder b/docker/Dockerfile.builder index d8561ca9..b53cdf2b 100644 --- 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 index bb537047..e656ecb0 100644 --- 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 /git-repos/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 /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 OSv git repo -RUN scripts/setup.py -RUN rm -rf /git-repos +# - install all required packages and remove scripts +RUN python3 /git-repos/osv/scripts/setup.py && rm -rf /git-repos/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 /git-repos/osv CMD /bin/bash diff --git a/docker/Dockerfile.builder-ubuntu-base b/docker/Dockerfile.builder-ubuntu-base index 9c9bf551..acf0b2a3 100644 --- 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 /git-repos/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 /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 delete OSv repo -RUN scripts/setup.py -RUN rm -rf /git-repos +# - install all required packages and remove 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 -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 /git-repos/osv CMD /bin/bash diff --git a/docker/Dockerfile.runner-fedora b/docker/Dockerfile.runner-fedora index bebcb8d4..3155ace0 100644 --- 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 \ @@ -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 index 247612a2..14641655 100644 --- 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 @@ -21,12 +21,11 @@ RUN apt-get update -y && apt-get install -y \ git \ python3 \ curl \ -wget \ qemu-system-x86 \ qemu-utils # - prepare directories -RUN mkdir /git-repos /result +RUN mkdir /git-repos # - clone OSv WORKDIR /git-repos @@ -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 @@ -51,7 +50,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 index 9fee9f17..1761da45 100644 --- 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. -- 2.26.1 -- 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/VI1PR03MB4383FB4A92D5ED68540ACA4DA6D90%40VI1PR03MB4383.eurprd03.prod.outlook.com.
