This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
forked from chaoss/grimoirelab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-factory
66 lines (56 loc) · 2 KB
/
Dockerfile-factory
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
56
57
58
59
60
61
62
63
64
65
66
# Copyright (C) 2016-2017 Bitergia
# GPLv3 License
#
# Build GrimoireLab packages, install them, check them
#
FROM debian:stretch-slim
MAINTAINER Jesus M. Gonzalez-Barahona <[email protected]>
ENV DEBIAN_FRONTEND=noninteractive
ENV DEPLOY_USER=grimoirelab
ENV DEPLOY_USER_DIR=/home/${DEPLOY_USER}
ENV DIST_SCRIPT=/usr/local/bin/build_grimoirelab \
LOGS_DIR=/logs \
DIST_DIR=/dist \
REL_FILE=/release
# install dependencies
RUN apt-get update && \
apt-get -y install --no-install-recommends \
bash locales \
gcc \
git git-core \
pandoc \
python3 \
python3-pip \
python3-venv \
python3-dev \
python3-gdbm \
mariadb-client \
unzip curl wget sudo ssh \
&& \
apt-get clean && \
find /var/lib/apt/lists -type f -delete
# Initial user and dirs
RUN useradd ${DEPLOY_USER} --create-home --shell /bin/bash ; \
echo "${DEPLOY_USER} ALL=NOPASSWD: ALL" >> /etc/sudoers ; \
mkdir ${DIST_DIR} ; chown -R ${DEPLOY_USER}:${DEPLOY_USER} ${DIST_DIR} ; \
mkdir ${LOGS_DIR} ; chown -R ${DEPLOY_USER}:${DEPLOY_USER} ${LOGS_DIR}
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8 \
LANG=C.UTF-8
# Add script to create distributable packages
ADD utils/build_grimoirelab ${DIST_SCRIPT}
RUN chmod 755 ${DIST_SCRIPT}
USER ${DEPLOY_USER}
WORKDIR ${DEPLOY_USER_DIR}
ADD releases/latest ${REL_FILE}
# Unbuffered output for Python, so that we see messages as they are produced
ENV PYTHONUNBUFFERED 0
# Entrypoint (build GrimoireLab packages), and default arguments for it
ENTRYPOINT [ "/usr/local/bin/build_grimoirelab", "--distdir", "/dist", \
"-l", "debug", "--logfile", "/logs/build.log" ]
CMD [ "--build", "--install", "--check", "--test", "--fail", "--relfile", "/release" ]