Containerized Build Runner
Introduction
A docker image based from python:2.7.11
that can be used to run a lcp-compose commands in a containerized environment.
Dockerfile for the image can be found in the lcp-compose repository at dockerfiles/build-image/Dockerfile
.
Purpose
Since lcp-compose makes certain assumptions regarding the environment that it is being executed on, containerizing the runner guarantees a consistent environment.
Assumptions
- The docker socket mounted from the host at
/var/run/docker.sock
- If any docker volumes are mounted or containers are built during a test run, the directories and /path/to/Dockerfile's should be mounted from the host's file-system at exact absolute paths.
Environment Variables
UID
: Linux user id of the test user.GID
: Linux group id of the test user.PROJECT_NAME
: Namespace for the docker-compose project.PROJECT_DIR
: Directory which the test commands are executed.
How to use the build image
PROJECT_NAME=points_service
PROJECT_DIR=$(pwd) # /path/to/points_service
docker run --rm --network=host \
--env UID=$(id --user) \
--env GID=$(id --group) \
--env PROJECT_NAME=$PROJECT_NAME \
--env PROJECT_DIR=$PROJECT_DIR \
--volume "/var/run/docker.sock:/var/run/docker.sock" \
--volume "$PROJECT_DIR:$PROJECT_DIR" \
dev-docker.points.com/lcpcompose-containerized:latest '\
virtualenv --no-site-packages /tmp/venv && . /tmp/venv/bin/activate && \
fab integration_tests \
'