Skip to content

Commit

Permalink
Improve docker test-env builds
Browse files Browse the repository at this point in the history
 * Let the container run in the non-interactive mode and uses slightly less disk space.
 * Update/add .gitignore and .dockerignore to exclude a local virutalenv if exists.
  • Loading branch information
achimnol committed May 30, 2017
1 parent 861e50d commit e2a166f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
venv*
virtualenv*
*.log
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,8 @@ target/
# Project
tags
ci/aioodbc
sqlite.db

# virtual envs
venv*/
virtualenv*/
9 changes: 8 additions & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM python:3.5.2-slim
FROM python:3.6.1-slim

# configure apt to install minimal dependencies in non-interactive mode.
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf; \
echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf

RUN apt-get update && apt-get install -y \
unixODBC wget g++ unixodbc-dev odbc-postgresql libmyodbc libsqlite-dev libtool build-essential && \
odbcinst -i -d -f /usr/share/libmyodbc/odbcinst.ini && \
Expand All @@ -10,6 +16,7 @@ RUN pip install -e /aioodbc/ && \
pip install -U pip setuptools && \
pip install -r /aioodbc/requirements-dev.txt

# with --squash option in docker build, this will reduce the final image size a bit.
RUN rm -rf /aioodbc && \
rm libsqliteodbc_0.9992-0.1_amd64.deb && \
apt-get purge -y g++ && \
Expand Down
2 changes: 1 addition & 1 deletion ci/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build:
docker build --rm -t jettify/aioodbc-test -f Dockerfile $(pwd)../
docker build --rm --squash -t jettify/aioodbc-test -f Dockerfile $(pwd)../

0 comments on commit e2a166f

Please sign in to comment.