-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
110 lines (97 loc) · 3.14 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
FROM debian:10-slim
# Install additional packages.
ARG DEB_MIRROR=http://ftp.de.debian.org/debian
ENV DEBIAN_FRONTEND=noninteractive
ENV CONTAINER=docker
RUN echo "deb ${DEB_MIRROR} buster main" > /etc/apt/sources.list \
&& apt-get update \
&& apt-get -y install --no-install-recommends \
python3 \
python3-setuptools \
python3-apt \
python3-pip \
python3-dev \
python3-wheel \
python3-stdeb \
python3-websocket \
python3-requests \
python3-all \
openssh-server \
git \
build-essential \
debhelper \
dh-python \
python-docutils \
python-sphinx \
fakeroot \
bash-completion \
locales \
aptly \
geoip-bin \
geoip-database \
geoip-database-extra
RUN locale-gen en_US.UTF-8 # Fix locale errors
#
# Install Docker CE CLI
#
RUN apt-get update \
&& apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker-ce-cli \
#
# Install Docker Compose
&& curl -sSL "https://github.com/docker/compose/releases/download/1.28.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose
# Install VNC server and desktop environment
ARG INSTALL_VNC=0
RUN if [ "$INSTALL_VNC" = "1" ]; then \
apt-get -y install \
xfce4 \
xfce4-goodies \
tightvncserver \
# Set VNC server password
&& mkdir /root/.vnc \
&& echo test456# | vncpasswd -f > /root/.vnc/passwd \
&& chmod 600 /root/.vnc/passwd; \
fi
# Set root passwd for container
RUN mkdir /var/run/sshd
RUN echo 'root:test123#' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
# Configure bash settings
RUN echo "source /etc/profile.d/bash_completion.sh" >> "/root/.bashrc"
WORKDIR /root
RUN mkdir $HOME/.cumulocity
COPY ./config/agent.ini /root/.cumulocity/agent.ini
# # Install requirements (using pip)
COPY ./requirements.txt .
RUN pip3 install -r requirements.txt
COPY ./setup.py .
COPY ./c8ydm ./c8ydm
RUN pip3 install .
# Clean up unnecessary packages
ARG CLEAN_PACKAGES=1
RUN if [ "$CLEAN_PACKAGES" = "1" ]; then \
apt-get -y --purge autoremove \
git \
build-essential \
debhelper \
dh-python \
python-docutils \
python-sphinx \
fakeroot \
bash-completion \
locales \
aptly \
python3-all \
python3-pip \
python3-dev \
python3-wheel \
python3-stdeb \
python3-setuptools; \
fi
COPY ./scripts ./scripts
CMD scripts/start_docker.sh