tobiko/Dockerfile
Federico Ressi c50ab412a0 Create Docker files for Tobiko project
- Dockerfile file is intended for running test cases
  without using tox
- infrared_plugin/Dockerfile file is intended to run
  Tobiko IR plugin
- docker-compose file is intended to emulate the tox
  experience by using docker

All images are build staring from official CentOS 8
image.

Change-Id: I2f57f6e1c9c6161cef9448d25027d784ebd37e2c
2020-06-01 10:19:21 +02:00

40 lines
1.1 KiB
Docker

ARG base_image="docker.io/library/centos:8"
FROM "${base_image}" as tobiko
# Install binary dependencies
RUN dnf install -y gcc git python3 python3-devel && \
alternatives --set python /usr/bin/python3
# Get Tobiko source files
ARG tobiko_src_dir=.
ENV TOBIKO_DIR=/src/tobiko
# Copy Tobiko source files
RUN mkdir /src
ADD "${tobiko_src_dir}" "${TOBIKO_DIR}"
WORKDIR "${TOBIKO_DIR}"
# Install Python requirements
ARG constraints_file=https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt
ENV PIP_INSTALL="python -m pip install -c ${constraints_file}"
RUN set -x && \
python --version && \
${PIP_INSTALL} --upgrade pip && \
${PIP_INSTALL} --upgrade setuptools wheel && \
${PIP_INSTALL} -r ./requirements.txt && \
${PIP_INSTALL} ./
# -----------------------------------------------------------------------------
FROM tobiko as tests
RUN ${PIP_INSTALL} -r ./test-requirements.txt
# Run test cases
ENV OS_LOG_CAPTURE=true
ENV OS_STDOUT_CAPTURE=true
ENV OS_STDERR_CAPTURE=true
ENV OS_TEST_PATH=tobiko/tests/unit
ENTRYPOINT ./tools/run_tests.py