-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
96 lines (73 loc) · 2.84 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
############################################################
# Trobz's Ubuntu 14.04 base image
############################################################
FROM ubuntu:14.04
MAINTAINER Thuan Duong <[email protected]>
# disable interactive debconf mode
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Install all dependencies
############################################################
COPY config/apt/sources.14.04.list /etc/apt/sources.list
COPY config/apt/apt.conf.d /etc/apt/apt.conf.d
# Linux command line tools
RUN apt-get update && apt-get -qq -y dist-upgrade && \
apt-get install -qq -y sudo openssh-server supervisor aptitude apt-transport-https \
dnsutils net-tools mtr-tiny nmap ngrep telnet traceroute iputils-ping netstat-nat \
htop ncdu nano lynx vim-nox zsh bash-completion screen tig tmux lftp apt-utils \
wget curl git-core locate man rsync build-essential make gcc keychain \
dialog locales software-properties-common python-software-properties && \
rm -rf /var/lib/apt/lists/*
# Configure timezone and locale
RUN echo "Asia/Ho_Chi_Minh" > /etc/timezone; dpkg-reconfigure -f noninteractive tzdata
RUN locale-gen en_US.UTF-8 && \
dpkg-reconfigure locales && \
/usr/sbin/update-locale LANG=en_US.UTF-8
# Set locale environment
COPY config/user/locale /etc/default/locale
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Install Trobz's certificates by default
COPY config/cert/bundle.crt /usr/local/share/ca-certificates/trobz_bundle.crt
COPY config/cert/trobz.crt /usr/local/share/ca-certificates/trobz.crt
RUN update-ca-certificates
# sudo
COPY config/user/sudoers /etc/sudoers
RUN chmod 0440 /etc/sudoers
# bash shell
COPY config/user/bash.bashrc /tmp/setup/user/bash.bashrc
COPY config/user/skel /etc/skel
COPY scripts/common /etc/bash
COPY scripts/bash /etc/bash.d
# vim
ADD config/vim/vim.tar.gz /tmp/setup
# supervisor
COPY config/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
RUN mkdir -p /var/run/supervisor
RUN mkdir -p /var/log/supervisor
# sshd
RUN mkdir /var/run/sshd
RUN chmod 0755 /var/run/sshd
# configure ssh server service with supervisord
COPY config/supervisor/conf.d/sshd.conf /etc/supervisor/conf.d/sshd.conf
# install latest git from launchpad ppa
COPY scripts/setup/git.sh /tmp/setup/git/git.sh
RUN /bin/bash < /tmp/setup/git/git.sh
RUN mkdir -p /var/log/docker
RUN chmod a+rw /var/log/docker -R
COPY scripts/start /usr/local/docker/start
RUN chmod +x /usr/local/docker/start -R
# Finalization
############################################################
VOLUME ["/var/log/docker"]
ENV USERNAME docker
ENV PASSWORD docker
ENV USER_UID 1000
ENV USER_GID 1000
ENV USER_HOME /home/docker
ONBUILD RUN apt-get update
ONBUILD RUN apt-get dist-upgrade -y
ONBUILD RUN updatedb
EXPOSE 22 8011
# USER root
CMD [ "/usr/local/docker/start/main.sh" ]