Skip to content

Commit

Permalink
Add docker files to help setup OSv build environment for Ubuntu/Fedora
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Kozaczuk <[email protected]>
  • Loading branch information
wkozaczuk committed Aug 14, 2019
1 parent 18df2ad commit 0aad78b
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker/Dockerfile
51 changes: 51 additions & 0 deletions docker/Dockerfile.Fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# Copyright (C) 2017 XLAB, Ltd.
# Copyright (C) 2018 Waldemar Kozaczuk
#
# This work is open source software, licensed under the terms of the
# BSD license as described in the LICENSE file in the top-level directory.
#
# This Docker file defines a container intended to build, test and publish
# OSv kernel as well as many applications ...
#
#FROM fedora:27 #On Jenkins build machine
FROM fedora:29

RUN yum install -y git python2 file which

#
# PREPARE ENVIRONMENT
#

# - prepare directories
RUN mkdir /git-repos /result

# - clone OSv
WORKDIR /git-repos
RUN git clone https://github.com/cloudius-systems/osv.git
WORKDIR /git-repos/osv
RUN git submodule update --init --recursive

# - install all required packages
RUN scripts/setup.py

# - install Capstan
RUN wget https://github.com/cloudius-systems/capstan/releases/latest/download/capstan -O /usr/local/bin/capstan
RUN chmod u+x /usr/local/bin/capstan

CMD /bin/bash

#
# NOTES
#
# Build the container example:
# docker build -t osv/builder-fedora -f Dockerfile.Fedora .
#
# Run the container FIRST time example:
# docker run -it --privileged osv/builder-fedora
#
# To restart:
# docker restart ID (from docker ps -a) && docker attach ID
#
# To open in another console
# docker exec -it ID /bin/bash
58 changes: 58 additions & 0 deletions docker/Dockerfile.Ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#
# Copyright (C) 2017 XLAB, Ltd.
# Copyright (C) 2018 Waldemar Kozaczuk
#
# This work is open source software, licensed under the terms of the
# BSD license as described in the LICENSE file in the top-level directory.
#
# This Docker file defines a container intended to build, test and publish
# OSv kernel as well as many applications ...
#
FROM ubuntu:19.04

ENV DEBIAN_FRONTEND noninteractive
ENV TERM=linux

COPY ./etc/keyboard /etc/default/keyboard
COPY ./etc/console-setup /etc/default/console-setup

RUN apt-get update -y && apt-get install -y git python2

#
# PREPARE ENVIRONMENT
#

# - prepare directories
RUN mkdir /git-repos /result

# - clone OSv
WORKDIR /git-repos
RUN git clone https://github.com/cloudius-systems/osv.git
WORKDIR /git-repos/osv
RUN git submodule update --init --recursive

# - install all required packages
RUN scripts/setup.py

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
RUN chmod u+x /usr/local/bin/capstan

CMD /bin/bash

#
# NOTES
#
# Build the container example:
# docker build -t osv/builder-ubuntu -f Dockerfile.Ubuntu .
#
# Run the container FIRST time example:
# docker run -it --privileged osv/builder-ubuntu
#
# To restart:
# docker restart ID (from docker ps -a) && docker attach ID
#
# To open in another console:
# docker exec -it ID /bin/bash
41 changes: 41 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Docker OSv builder
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
```
docker build -t osv/builder . # Use default Fedora-base file
docker build -t osv/builder -f Dockerfile.Ubuntu . # Use specific docker file
```

Run container
```
docker run -it --privileged osv/builder
```

After starting you will end up in /git-repos/osv directory
where you can build OSv kernel and example app like so:
```bash
./scripts/build image=native-example
```

To run it:
```bash
./scripts/run.py
```

Run this to learn all kinds of options the build and run.py script accepts:
```bash
./scripts/build --help
./scripts/run.py --help
```

To refresh OSv code the latest version run this in /git-repos/osv directory:
```bash
git pull
```

To update Fedora/Ubuntu packages run this in /git-repos/osv directory:
```bash
./script/setup.py
```
16 changes: 16 additions & 0 deletions docker/etc/console-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CONFIGURATION FILE FOR SETUPCON

# Consult the console-setup(5) manual page.

ACTIVE_CONSOLES="/dev/tty[1-6]"

CHARMAP="UTF-8"

CODESET="guess"
FONTFACE="Fixed"
FONTSIZE="8x16"

VIDEOMODE=

# The following is an example how to use a braille font
# FONT='lat9w-08.psf.gz brl-8x8.psf'
10 changes: 10 additions & 0 deletions docker/etc/keyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

0 comments on commit 0aad78b

Please sign in to comment.