-
Notifications
You must be signed in to change notification settings - Fork 160
/
Dockerfile
63 lines (58 loc) · 1.83 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
56
57
58
59
60
61
62
63
FROM ubuntu:24.04@sha256:80dd3c3b9c6cecb9f1667e9290b3bc61b78c2678c02cbdae5f0fea92cc6734ab
ARG APT_PKGS="\
apt-transport-https \
curl \
gnupg \
language-pack-en-base \
software-properties-common"
ARG APT_BUILD_PKGS="\
autoconf \
automake \
bison \
build-essential \
gawk \
git \
gnupg2 \
gosu \
libffi-dev \
libgdbm-dev \
libgmp-dev \
libncurses5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libtool \
libyaml-dev \
pkg-config \
sqlite3 \
zlib1g-dev"
ARG BAZELISK_VERSION=1.10.1
ENV LANGUAGE en_US:en
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV USER_ID=1000
ENV USER_HOME=/home/buildbazel
ENV DEFAULT_USER_NAME=buildbazel
ENV USER_NAME=$DEFAULT_USER_NAME
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y -qq --no-install-recommends $APT_PKGS \
&& echo 'Acquire::Languages {"none";};' > /etc/apt/apt.conf.d/60language \
&& echo "LANG=\"${LANG}\"" > /etc/default/locale \
&& echo "LANGUAGE=\"${LANGUAGE}\"" >> /etc/default/locale \
&& locale-gen "$LANG" \
&& update-locale "$LANG" \
# git version must be >= 2.26
&& add-apt-repository -y ppa:git-core/ppa \
&& apt-get update \
&& apt-get install -y -qq --no-install-recommends $APT_BUILD_PKGS \
&& curl -fsSL --output \
/usr/local/bin/bazel \
"https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VERSION}/bazelisk-linux-$(dpkg --print-architecture)" \
&& chmod +x /usr/local/bin/bazel \
&& useradd --shell /bin/bash -u "$USER_ID" -o -d "$USER_HOME" -c "" -m "$USER_NAME" || : \
&& mkdir -p "${USER_HOME}/.cache/bazel" \
&& mkdir -p "${USER_HOME}/.cache/bazelisk" \
&& chown -R $USER_NAME "${USER_HOME}/.cache"
ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]