-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (46 loc) · 1.65 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (46 loc) · 1.65 KB
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
#
# Dockerfile - Google Kubernetes
#
# - Build
# docker build --rm -t kubernetes:client -f 01_kubernetes-client .
#
# - Run
# docker run -d --name="kubernetes-client" -h "kubernetes-client" kubernetes:client
#
# - SSH
# ssh `docker inspect -f '{{ .NetworkSettings.IPAddress }}' kubernetes-client`
# Use the base images
FROM ubuntu:16.04
MAINTAINER Yongbok Kim <ruo91@yongbok.net>
# Change the repository
RUN sed -i 's/archive.ubuntu.com/ftp.daumkakao.com/g' /etc/apt/sources.list
# The last update and install package for docker
RUN apt-get update && apt-get install -y supervisor openssh-server nano net-tools iputils-ping
# Variable
ENV SRC_DIR /opt
WORKDIR $SRC_DIR
# Google - Kubernetes
ENV KUBERNETES_HOME $SRC_DIR/kubernetes
ENV PATH $PATH:$KUBERNETES_HOME/client/bin
ADD kubernetes-client-linux-amd64.tar.gz $SRC_DIR
ADD conf/yaml/nginx.yaml $SRC_DIR/nginx.yaml
ADD conf/yaml/skydns.yaml $SRC_DIR/skydns.yaml
ADD conf/yaml/dashboard.yaml $SRC_DIR/dashboard.yaml
RUN echo '# Kubernetes' >> /etc/profile \
&& echo "export KUBERNETES_HOME=$KUBERNETES_HOME" >> /etc/profile \
&& echo 'export PATH=$PATH:$KUBERNETES_HOME/client/bin' >> /etc/profile \
&& echo '' >> /etc/profile
# Supervisor
RUN mkdir -p /var/log/supervisor
ADD conf/supervisord/00_default.conf /etc/supervisor/conf.d/supervisord.conf
# SSH
RUN mkdir /var/run/sshd
RUN sed -i '/^#UseLogin/ s:.*:UseLogin yes:' /etc/ssh/sshd_config
RUN sed -i 's/\#AuthorizedKeysFile/AuthorizedKeysFile/g' /etc/ssh/sshd_config
RUN sed -i '/^PermitRootLogin/ s:.*:PermitRootLogin yes:' /etc/ssh/sshd_config
# Set the root password for ssh
RUN echo 'root:kubernetes' |chpasswd
# Port
EXPOSE 22
# Daemon
CMD ["/usr/bin/supervisord"]