-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
55 lines (49 loc) · 1.34 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Docker image for installing dependencies on Linux and running tests.
# Build with:
# docker build --tag=qrscan .
# Run with:
# docker run qrscan /bin/sh -c 'make test'
# Or for interactive shell:
# docker run -it --rm qrscan
FROM ubuntu:20.04
ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}/app"
# configure locale
RUN apt update -qq > /dev/null \
&& DEBIAN_FRONTEND=noninteractive apt install -qq --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 \
&& DEBIAN_FRONTEND=noninteractive apt install -qq --yes --no-install-recommends \
build-essential \
ccache \
cmake \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libpython3.8-dev \
libzbar-dev \
lsb-release \
make \
pkg-config \
python3.8 \
python3.8-dev \
python3.8-venv \
sudo \
virtualenv
# prepare non root env
RUN useradd --create-home --shell /bin/bash ${USER}
# with sudo access and no password
RUN usermod -append --groups sudo ${USER}
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
WORKDIR ${WORK_DIR}
COPY . ${WORK_DIR}
RUN chown -R ${USER}:${USER} ${WORK_DIR}
USER ${USER}
RUN make virtualenv