-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile
133 lines (92 loc) · 3 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
FROM ubuntu:22.04
## Basic devcontainer setup
ENV user=devpod
ENV JAVA_VERSION=8
ENV SCALA_VERSION=2.12
ENV BINARY_SCALA_VERSION=2.12.12
ENV JULIA_VERSION=1.10.5
ENV JULIA_VERSION_SHORT=1.10
ENV KAFKA_VERSION=${SCALA_VERSION}-3.8.0
ENV KAFKA_VERSION_SHORT=3.8.0
ENV TERM=xterm-color
ENV DEBIAN_FRONTEND=noninteractive \
TERM=linux
ENV LANGUAGE=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
LC_CTYPE=en_US.UTF-8 \
LC_MESSAGES=en_US.UTF-8
# -------------------------- SUDO LAND ------------------------------
USER root
RUN apt update && apt install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
gpg \
gpg-agent \
less \
libbz2-dev \
libffi-dev \
liblzma-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
llvm \
locales \
tk-dev \
tzdata \
unzip \
vim \
wget \
xz-utils \
zlib1g-dev \
zstd \
&& sed -i "s/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g" /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
&& apt clean
## System packages
RUN apt-get update
RUN apt-get install -y git openssh-server
## Add user & enable sudo
# RUN id -u ${user} &>/dev/null || useradd -ms /bin/bash ${user}
RUN id -u ${user} || useradd -ms /bin/bash ${user}
RUN usermod -aG sudo ${user}
RUN apt-get install -y sudo
RUN echo "${user} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN chsh -s /bin/bash ${user}
# ensure home directory exists
RUN mkdir -p /home/${user}
RUN chown -R ${user}:${user} /home/${user}
RUN touch /home/${user}/.bashrc
RUN chown ${user}:${user} /home/${user}/.bashrc
## Julia
WORKDIR /opt
RUN wget -O julia.tgz https://julialang-s3.julialang.org/bin/linux/x64/${JULIA_VERSION_SHORT}/julia-${JULIA_VERSION}-linux-x86_64.tar.gz
RUN tar -xzf julia.tgz
RUN echo "export PATH=\${PATH}:/opt/julia-${JULIA_VERSION}/bin" >> /home/${user}/.bashrc
RUN rm julia.tgz
## Java & Maven
RUN apt-get install -y openjdk-${JAVA_VERSION}-jdk
RUN update-alternatives --set java $(update-alternatives --list java | grep java-${JAVA_VERSION}) || true
RUN update-alternatives --set javac $(update-alternatives --list java | grep java-${JAVA_VERSION}) || true
RUN apt-get install -y maven
## Kafka
WORKDIR /opt
RUN wget -O kafka.tgz https://dlcdn.apache.org/kafka/${KAFKA_VERSION_SHORT}/kafka_${KAFKA_VERSION}.tgz
RUN tar -xzf kafka.tgz
RUN echo "export PATH=\${PATH}:/opt/kafka_${KAFKA_VERSION}/bin" >> /home/${user}/.bashrc
RUN rm kafka.tgz
RUN mkdir -p /opt/kafka_${KAFKA_VERSION}/logs
RUN chmod -R a+rwx /opt/kafka_${KAFKA_VERSION}/logs
## Scripts
ENV RDKAFKA_TEST_DIR=/opt/RDKafka.jl
COPY . ${RDKAFKA_TEST_DIR}
RUN chown -R ${user}:${user} ${RDKAFKA_TEST_DIR}
# -------------------------- USER LAND ------------------------------
USER ${user}
## Launch
ENTRYPOINT ["/opt/RDKafka.jl/scripts/run-tests.sh"]