Skip to content

Commit

Permalink
Initial revision
Browse files Browse the repository at this point in the history
Change-Id: If4aa53cbd6ab37f6f9491fc672d922670bafecee
  • Loading branch information
guillon committed Aug 18, 2016
0 parents commit 3fc1113
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 0 deletions.
66 changes: 66 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM debian:jessie-backports

#
# Installs lava-server from images.validation.linaro.org repository.
#
# Sources at: https://github.com/guilon/lava-server.
#
# For LAVA installation documentation, refer to:
# http://www.linaro.org/
# https://porter.automotivelinux.org/static/docs/v2/
# https://porter.automotivelinux.org/static/docs/v2/installing_on_debian.html
#
# In order to access the lava-server http service, one may at least
# bind the port 80, for instance run this image with:
#
# $ docker run --name lava-server -d -p 8080:80 guillon/lava-server
#
# and browse lava-server at http://localhost:8080.
#
# Note that it is important to split the installation of postgresql
# and lava-server into separate commands and start postgresql before
# actually installing lava-server which needs a running instance for
# confiouration.
#
# Note that the provided entrypoint.sh will create an initial admin
# accouint optionally and set the initial password to changeit.
#
# The important VOLUMES for persistent storage are defined at the end
# of the file.
#

MAINTAINER Christophe Guillon <christophe.guillon@st.com>

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y wget && \
wget -q http://images.validation.linaro.org/production-repo/production-repo.key.asc && \
apt-key add production-repo.key.asc && rm production-repo.key.asc && \
echo "deb http://images.validation.linaro.org/production-repo sid main" >/etc/apt/sources.list.d/linaro.list

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y expect postgresql && \
apt-get install -t jessie-backports -y python-django python-django-tables2 && \
apt-get install -y lava-tool lava-dispatcher lava-coordinator && \
apt-get install -y apache2

RUN service postgresql start && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y lava-server && \
service postgresql stop && \
apt-get clean

RUN a2dissite 000-default && \
a2ensite lava-server.conf

VOLUME /var/lib/lava
VOLUME /var/lib/lava-server
VOLUME /var/lib/postgresql

EXPOSE 80
EXPOSE 5432
EXPOSE 3079

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This software is delivered under the terms of the MIT License

Copyright (c) 2016 STMicroelectronics

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
LAVA Server image for LAVA at http://www.linaro.org
===================================================

Installs lava-server from images.validation.linaro.org repository.

Usage
=====

In order to access the lava-server http service, one may at least
bind the port 80, for instance run this image with:

$ docker run --name lava-server -d -p 8080:80 guillon/lava-server

and browse lava-server at http://localhost:8080.

A local admin account is available with login / password: admin / changeit

Implementation
==============

Refer to comments in the Dockerfile at
https://github.com/guillon/docker-lava-server/blob/master/Dockerfile

References
==========

Sources at: https://github.com/guilon/lava-server.

For LAVA installation documentation, refer to:

- http://www.linaro.org/
- https://porter.automotivelinux.org/static/docs/v2/
- https://porter.automotivelinux.org/static/docs/v2/installing_on_debian.html

Legal
=====

Distributed as is under the MIT licence.

Copyright (C) STMicroelectronics 2016.


46 changes: 46 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
#
# entrypoint.sh
# This is the default entrypoint for this image.
# By default, it:
# - starts postgresql service
# - starts lava services
# - starts apache service
# - adds admin local user if it doesn't already exists.
#
# Usages:
# /entrypoint.sh : starts the default services and infinite sleep
# /entrypoint.sh cmd... : executes cmd... instead
# ./entrypoint.sh -- cmd...: starts the default services and execute cmd...
#

set -euo pipefail

[ $# = 0 -o "${1-}" = "--" ] || exec "$@"

echo "Starting postgresql..."
service postgresql start

echo "Starting lava-coordinator..."
service lava-coordinator start

echo "Starting lava-server..."
service lava-server start

echo "Starting apache2 server..."
service apache2 start

echo "Creating admin account optionally, initial password is: changeit"
lava-server manage createsuperuser --noinput \
--username=admin --email=lavaserver@localhost 2>/dev/null && \
expect -c 'spawn lava-server manage changepassword admin;expect "Password: ";send "changeit\n";expect "Password (again): ";send "changeit\n";expect "Password changed successfully for user *";interact'

if [ "${1-}" = "--" ]; then
shift
echo "Executing:" "$@"
exec "$@"
else
echo "Executing: sleep infinity"
sleep infinity
fi

0 comments on commit 3fc1113

Please sign in to comment.