Skip to content

Commit

Permalink
Linux Dockerfile, automates project build
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Jun 8, 2018
1 parent 463f8ef commit f0c8e2a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
@@ -0,0 +1,6 @@
venv/
.git/
.buildozer/
.pytest_cache/
.tox/
bin/
35 changes: 35 additions & 0 deletions dockerfiles/Dockerfile-linux
@@ -0,0 +1,35 @@
# Docker image for installing dependencies on Linux and running tests.
# Build with:
# docker build --tag=pywallet-linux --file=dockerfiles/Dockerfile-linux .
# Run with:
# docker run pywallet-linux /bin/sh -c 'make test'
# Or using the entry point shortcut:
# docker run pywallet-linux 'make test'
# Or for interactive shell:
# docker run -it --rm pywallet-linux
# TODO:
# - delete archives to keep small the container small
# - setup caching (for apt, and pip)
FROM ubuntu:18.04

# configure locale
RUN apt update -qq > /dev/null && apt install --yes --no-install-recommends \
locales && \
locale-gen en_US.UTF-8
ENV LANG="en_US.UTF-8" \
LANGUAGE="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"

# install system dependencies
RUN apt update -qq > /dev/null && apt install --yes --no-install-recommends \
make lsb-release sudo

# install kivy system dependencies
# https://kivy.org/docs/installation/installation-linux.html#dependencies-with-sdl2
RUN apt install --yes --no-install-recommends \
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev

WORKDIR /app
COPY . /app
RUN make
ENTRYPOINT ["./dockerfiles/start.sh"]
10 changes: 10 additions & 0 deletions dockerfiles/start.sh
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

# if a some command has been passed to container, executes it and exit,
# otherwise runs bash
if [[ $@ ]]; then
eval $@
else
/bin/bash
fi

0 comments on commit f0c8e2a

Please sign in to comment.