forked from Yubico/developers.yubico.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.build
62 lines (52 loc) · 1.69 KB
/
Dockerfile.build
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
FROM ubuntu:18.04
# drop multiverse, restricted, backports
RUN echo "deb http://archive.ubuntu.com/ubuntu/ bionic main universe" >/etc/apt/sources.list \
&& echo "deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe" >>/etc/apt/sources.list \
&& echo "deb http://archive.ubuntu.com/ubuntu/ bionic-security main universe" >>/etc/apt/sources.list
RUN apt-get -y update && apt-get -y dist-upgrade
RUN apt-get install --no-install-recommends -y \
git \
git-lfs \
# for yubico-binaries repo
openssh-client \
python-pip \
python-setuptools \
asciidoc \
mscgen \
libffi-dev \
libssl-dev \
source-highlight
COPY requirements.txt /
COPY pipcache/*.gz /
RUN pip install --upgrade pip
RUN pip install -r /requirements.txt
ARG uid
ARG gid
# MacOS default user's primary group has GID=20.
#
# Ubuntu container 'dialout' group also has GID=20;
#
# jean@thinkpad:~$ docker run --rm -it ubuntu:16.04
# root@3bb92dbf5716:/# getent group 20
# dialout:x:20:
#
# Change container's 'dialout' GID to avoid conflict;
#
# root@3bb92dbf5716:/# groupmod -g 9000 dialout
# root@3bb92dbf5716:/# getent group dialout
# dialout:x:9000:
#
# NOTE: files owned by dialout group won't automatically be updated to GID=9000,
# meaning a new group with GID=20 will gain group ownership on such pre-existing files.
#
# This shouldn't be a problem as typically 'dialout' is the group owner of /dev/tty*,
# and TTY devices shouldn't be available within this container.
RUN groupmod -g 9000 dialout
RUN addgroup --gid $gid build
RUN adduser --home /home/build --shell /bin/bash --disabled-login --gecos '' \
--uid $uid --gid $gid \
build
USER build
VOLUME /developers
WORKDIR /developers
CMD ["./build"]