-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile.test
32 lines (25 loc) · 1.16 KB
/
Dockerfile.test
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
FROM python:3
RUN apt-get update && \
apt-get install curl -y && \
curl -sSL https://get.docker.com/ | sh && \
apt-get install -y ssh docker-compose-plugin && \
# pin pyyaml to 5.3.1 until https://github.com/yaml/pyyaml/issues/724 is fixed
pip install pyyaml==5.3.1 && \
pip install awscli
# By default, sshd runs on port 22, we need it to run on port 2222
RUN sed -i 's/#Port 22/Port 2222/g' /etc/ssh/sshd_config
# kubectl is required to be present in the container running the agent
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# Semaphore toolbox should also be available
RUN curl -sL https://github.com/semaphoreci/toolbox/releases/latest/download/self-hosted-linux.tar -o toolbox.tar && \
tar -xf toolbox.tar && \
mv toolbox /root/.toolbox && \
/root/.toolbox/install-toolbox && \
echo 'source ~/.toolbox/toolbox' >> /root/.bash_profile && \
rm toolbox.tar
ADD server.key /app/server.key
ADD server.crt /app/server.crt
ADD build/agent /app/agent
WORKDIR /app
CMD service ssh restart && ./agent serve --port 30000