Copy source into image rather than mount in container
@acmiyaguchi reported that with the source mounted into the container, cache files were written to the local file system that then couldn't be removed without sudo on an Ubuntu host. This change should make sure all cache files are written inside the container so they don't hit the local filesystem.
This commit is contained in:
Родитель
9bf1383ec4
Коммит
8acb376e37
|
@ -1,5 +1,5 @@
|
|||
# Files/directories matching the patterns here will not be included
|
||||
# in the Docker context when you run `docker build`.
|
||||
|
||||
# The tox caches can be large; we ignore them to speed up builds.
|
||||
.*tox/
|
||||
.*
|
||||
*.egg*
|
||||
|
|
|
@ -7,3 +7,9 @@ FROM python:$PYTHON_VERSION
|
|||
|
||||
RUN apt-get update && apt-get install -y libsnappy-dev openjdk-8-jre-headless
|
||||
RUN pip install tox
|
||||
|
||||
WORKDIR /python_moztelemetry
|
||||
|
||||
# Copy the current directory as is to the workdir;
|
||||
# Relies on the .dockerignore file to prune out large files we don't want to include.
|
||||
COPY . .
|
||||
|
|
7
bin/test
7
bin/test
|
@ -8,7 +8,7 @@ cd $(git rev-parse --show-toplevel)
|
|||
|
||||
# Set default variables if not already present in the environment.
|
||||
: ${PYTHON_VERSION:=3.6}
|
||||
: ${WORKDIR:=.dockertox} # Prevents the circleci cli from picking up the env
|
||||
: ${TOXDIR:=.dockertox} # Prevents the circleci cli from picking up the env
|
||||
: ${TOXENV:="py${PYTHON_VERSION/./}"}
|
||||
|
||||
# Set some derived variables.
|
||||
|
@ -22,7 +22,8 @@ docker build -t moztelemetry:"$TOXENV" --build-arg PYTHON_VERSION="$PYTHON_VERSI
|
|||
|
||||
# We mount the current directory to the container and run tox inside it.
|
||||
docker run -it --rm \
|
||||
--volume "$(pwd)":/python_moztelemetry \
|
||||
--volume "$(pwd)/$TOXDIR":/python_moztelemetry/"$TOXDIR" \
|
||||
--volume "$(pwd)"/.git:/python_moztelemetry/.git \
|
||||
--workdir /python_moztelemetry \
|
||||
moztelemetry:"$TOXENV" \
|
||||
tox --workdir $WORKDIR -e "$TOXENV" -- $@
|
||||
tox --workdir "$TOXDIR" -e "$TOXENV" -- $@
|
||||
|
|
Загрузка…
Ссылка в новой задаче