-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
67 lines (53 loc) · 2.4 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
# Copyright (C) 2015 zulily, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This is a Dockerfile for creating a ubuntu image with init, systemd and a masterless salt-minion
# Please see README.md for more information.
# Make sure to specify the Ubuntu base image here and to set the version for the
# UBUNTU_VERSION variable below
FROM ubuntu:15.10
MAINTAINER zulily
# Miscellaneous Settings
ENV UBUNTU_VERSION "15.10"
ENV SALT_VERSION "2015.8.1"
ENV TERM="vt100" XDG_RUNTIME_DIR="/run/user/$(id -u)"
LABEL ubuntu_version=$UBUNTU_VERSION
LABEL salt_version=$SALT_VERSION
LABEL masterless="true"
# Add some files we'll need for package installation
ADD files/sources.list /etc/apt/sources.list
ADD files/resolv.conf /etc/resolv.conf
# Update package lists
RUN apt-get update
# Install a few packages to get started, but leave package installation up to salt in general
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y apt-utils vim bind9-host curl iputils-ping software-properties-common
RUN mkdir -p /etc/salt/minion.d && \
chmod -R 755 /etc/salt
ADD files/10-minion-overrides.conf /etc/salt/minion.d/
# No agetty
RUN rm -f /etc/init/tty*
RUN rm -f /etc/systemd/system/getty.target.wants/*
RUN rm -f /sbin/agetty
# Update the .bashrc so once attached, the salt-minion will start if it is not the case.
ADD files/bashrc_update.sh /root/
RUN chmod +x /root/bashrc_update.sh
RUN /root/bashrc_update.sh && rm -f /root/bashrc_update.sh
# Install salt from the official git repo, a tagged release
# The salt-minion will fail to start because systemd cannot be started...
# docker build does not support --privileged. salt-minion does successfully install,
# so this error may be safely ignored. An || /bin/true is specified to have a zero return code
RUN apt-get install wget -y && \
curl -L https://bootstrap.saltstack.com -o install_salt.sh && \
sh install_salt.sh -X -P git v$SALT_VERSION || \
/bin/true
CMD [ "/sbin/init" ]