Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Dockerfile: Initial container definition
Browse files Browse the repository at this point in the history
Here's an initial container definition. It's pretty general purpose
at this point and just allows running the various commands in a
containerized fashion.
  • Loading branch information
stefwalter committed Apr 6, 2018
1 parent c0bede2 commit b738384
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM fedora:27

RUN dnf install -y python2 python2-junit_xml beaker-client \
bison flex python2-mock dnf-plugins-core procps-ng
RUN dnf builddep -y kernel

# Use a default checkout of the kernel as our srcdir
RUN git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git /work && \
chmod -R ugo+w /work

# Setup a valid git config in the container
RUN cd /work && \
git config user.email "[email protected]" && \
git config user.name "Sonic Kernel Testing"

# Pull a default kernel config down for use in the container
# It's expected that this will be overriden either by mounting a
# new config file, or by adding one in a layered container
RUN mkdir -p /var/src/config && \
curl -o /var/src/config/kernel-x86_64.config https://src.fedoraproject.org/rpms/kernel/raw/master/f/kernel-x86_64.config
ENV SKT_BASECONFIG=/var/src/config/kernel-x86_64.config

# Here's where our SKT work dir happens
WORKDIR /work
ENV SKT_WORKDIR=/work
ENV SKT_BUILDDIR=/work/build
RUN mkdir -p --mode=777 /work/build
VOLUME [ "/work/build" ]

# We don't pollute the container file system tree with
# massive intermediate build output
COPY . /var/src/skt
RUN cd /var/src/skt && ls && pip install -v .

ENTRYPOINT [ "/usr/bin/skt" ]
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,26 @@ virtual environment for skt quickly:

To deactivate the virtual environment, simply run `deactivate`.

Container
---------

The skt command and all its requirements, as well as a ready for use kernel
git tree are available in a container. You can run skt commands agains the
container environment like this:

% sudo docker run docker.io/kerneltest/skt -vv build

If you want to enter into the container and play with skt, for debugging
purposes, or looking at intermediate files:

$ sudo docker run -ti --entrypoint=/bin/bash docker.io/kerneltest/skt

If you change the Dockerfile that defines the container, you can rebuild
the container, and/or push a new version it if you have appropriate credentials:

$ sudo docker build -t docker.io/kerneltest/skt:latest .
$ sudo docker push docker.io/kerneltest/skt:latest

License
-------
skt is distributed under GPLv2 license.
Expand Down

0 comments on commit b738384

Please sign in to comment.