-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathDockerfile
45 lines (40 loc) · 2.19 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
ARG SOURCE_IMAGE
FROM ${SOURCE_IMAGE}
ENV USER scylla-test
SHELL ["/bin/bash", "-c"]
# Install sudo and other tools, disable autostart of scylla-server and scylla-housekeeping services,
# remove the login banner and add a new user.
#
# Password for the user is `test' and encrypted using openssl command:
# $ echo -n test | openssl passwd -crypt -stdin -salt 00
# 00hzYw5m.HyAY
#
# For more details see man page for useradd(8)
RUN apt-get update && apt-get install -y --no-install-recommends apt-transport-https gnupg2 software-properties-common curl ssh openssh-server openssh-client
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt-get update && \
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
apt install -y sudo && \
adduser --disabled-password --gecos "" $USER || true && \
usermod -aG sudo $USER && \
sudo -Hu $USER sh -c "mkdir -m 700 ~/.ssh" && \
sudo -Hu $USER sh -c "echo 'mkdir -p /home/$USER/.cassandra' > ~/.ssh/rc" && \
sudo -Hu $USER sh -c "echo 'sudo test -f /root/.cqlshrc && sudo cp /root/.cqlshrc /home/$USER/.cassandra/cqlshrc' >> ~/.ssh/rc" && \
sudo -Hu $USER sh -c "echo 'sudo test -f /root/.cassandra/cqlshrc && sudo cp /root/.cassandra/cqlshrc /home/$USER/.cassandra/cqlshrc' >> ~/.ssh/rc" && \
echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
apt install --no-install-recommends -y \
iproute2 \
syslog-ng \
rsync \
docker-ce-cli && \
rm -rf /var/lib/apt/lists/* && \
echo "autostart=false" >> /etc/supervisord.conf.d/scylla-server.conf && \
echo "user=scylla" >> /etc/supervisord.conf.d/scylla-server.conf && \
echo "autostart=false" >> /etc/supervisord.conf.d/scylla-housekeeping.conf && \
echo "user=scylla" >> /etc/supervisord.conf.d/scylla-housekeeping.conf
COPY docker-entrypoint.py /docker-entrypoint.py
RUN chmod +x /docker-entrypoint.py
COPY ./etc/scylla-manager.conf /etc/supervisord.conf.d/scylla-manager.conf
COPY ./etc/sshd.conf /etc/supervisord.conf.d/sshd.conf
COPY ./etc/sshd-service.sh /sshd-service.sh