Skip to content

Commit

Permalink
Initial Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Fathi Boudra <[email protected]>
  • Loading branch information
fboudra committed Nov 1, 2017
1 parent 6064183 commit c7124aa
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM debian:sid

# Basic docker image to get LAVA dispatcher running with QEMU device type
# Launch: docker run -it --privileged -u lava docker-lava-dispatcher bash

RUN echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections \
&& echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections \
&& apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
bridge-utils \
busybox \
git \
lava-dispatcher \
libguestfs-tools \
linux-image-amd64 \
locales \
openssh-server \
qemu-kvm \
qemu-system-arm \
qemu-system-x86 \
qemu-user-static \
ser2net \
vim \
&& apt clean \
&& rm -rf \
/etc/apt/sources.list.d/*.key \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*

# Example to generate the keyring.cfg
# lava-tool auth-add https://[email protected]/RPC2
# lava-tool auth-config --default-user https://[email protected]/RPC2
# lava-tool auth-config --endpoint-shortcut production https://[email protected]/RPC2
# lava-tool auth-list

COPY keyring.cfg .
RUN useradd -m -G plugdev lava \
&& echo 'lava ALL = NOPASSWD: ALL' > /etc/sudoers.d/lava \
&& chmod 0440 /etc/sudoers.d/lava \
&& mkdir -p /var/run/sshd /home/lava/bin /home/lava/.ssh /home/lava/.local/share/lava-tool /home/lava/output \
&& mv keyring.cfg /home/lava/.local/share/lava-tool/ \
&& chmod 0600 /home/lava/.local/share/lava-tool/keyring.cfg \
&& chmod 0700 /home/lava/.ssh \
&& chown -R lava:lava /home/lava/bin /home/lava/.ssh /home/lava/.local /home/lava/output

USER lava
RUN lava-tool get-pipeline-device-config --output /home/lava/qemu-dispatcher01_config.yaml production qemu-dispatcher01 \
&& curl -s https://validation.linaro.org/static/docs/v2/examples/test-jobs/qemu-pipeline-first-job.yaml > /home/lava/qemu-pipeline-first-job.yaml \
&& sed -i 's/command:/command: qemu-system-x86_64/g' /home/lava/qemu-dispatcher01_config.yaml
# Bug reported in qemu-dispatcher01_config.yaml - command is empty
# sudo lava-run --job-id 01 --output-dir /home/lava/output --device qemu-dispatcher01_config.yaml qemu-pipeline-first-job.yaml

EXPOSE 22
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -e

export LANG=C

image=docker-lava-dispatcher
docker build --pull --tag=$image .
4 changes: 4 additions & 0 deletions keyring.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# [https://dummy.validation.linaro.org/RPC2/]
# foo.bar = LAVA_TOKEN_HERE
# default-user = foo.bar
# endpoint-shortcut = production

0 comments on commit c7124aa

Please sign in to comment.