-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
77 lines (62 loc) · 2.69 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
FROM ubuntu:noble-20240530
ARG BUILD_DATE
ARG VCS_REF
# https://github.com/saltstack/salt/releases
ENV SALT_VERSION="3007.1"
ENV IMAGE_REVISION="_6"
ENV IMAGE_VERSION="${SALT_VERSION}${IMAGE_REVISION}"
ENV SALT_DOCKER_DIR="/etc/docker-salt" \
SALT_ROOT_DIR="/etc/salt" \
SALT_CACHE_DIR='/var/cache/salt' \
SALT_USER="salt" \
SALT_HOME="/home/salt"
ENV SALT_BUILD_DIR="${SALT_DOCKER_DIR}/build" \
SALT_RUNTIME_DIR="${SALT_DOCKER_DIR}/runtime" \
SALT_DATA_DIR="${SALT_HOME}/data"
ENV SALT_CONFS_DIR="${SALT_DATA_DIR}/config" \
SALT_KEYS_DIR="${SALT_DATA_DIR}/keys" \
SALT_BASE_DIR="${SALT_DATA_DIR}/srv" \
SALT_LOGS_DIR="${SALT_DATA_DIR}/logs" \
SALT_FORMULAS_DIR="${SALT_DATA_DIR}/3pfs"
RUN mkdir -p ${SALT_BUILD_DIR}
WORKDIR ${SALT_BUILD_DIR}
# Install packages
# hadolint ignore=DL3008
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
sudo ca-certificates apt-transport-https wget locales openssh-client gpg gpg-agent \
supervisor logrotate git gettext-base tzdata inotify-tools psmisc \
&& DEBIAN_FRONTEND=noninteractive update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX \
locale-gen en_US.UTF-8 \
dpkg-reconfigure locales \
&& DEBIAN_FRONTEND=noninteractive apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/*
# Install saltstack
COPY assets/build ${SALT_BUILD_DIR}
RUN bash ${SALT_BUILD_DIR}/install.sh
COPY assets/runtime ${SALT_RUNTIME_DIR}
RUN chmod -R +x ${SALT_RUNTIME_DIR}
COPY assets/sbin/* /usr/local/sbin/
# Cleaning tasks
RUN rm -rf "${SALT_BUILD_DIR:?}"/*
# Entrypoint
COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod +x /sbin/entrypoint.sh
# Shared resources
EXPOSE 4505 4506 8000
RUN mkdir -p "${SALT_BASE_DIR}" "${SALT_FORMULAS_DIR}" "${SALT_KEYS_DIR}" "${SALT_CONFS_DIR}" "${SALT_LOGS_DIR}"
LABEL org.opencontainers.image.title="Dockerized Salt Master"
LABEL org.opencontainers.image.description="salt-master ${SALT_VERSION} containerized"
LABEL org.opencontainers.image.documentation="https://github.com/cdalvaro/docker-salt-master/blob/${IMAGE_VERSION}/README.md"
LABEL org.opencontainers.image.url="https://github.com/cdalvaro/docker-salt-master"
LABEL org.opencontainers.image.source="https://github.com/cdalvaro/docker-salt-master.git"
LABEL org.opencontainers.image.authors="Carlos Álvaro <[email protected]>"
LABEL org.opencontainers.image.vendor="cdalvaro"
LABEL org.opencontainers.image.created="${BUILD_DATE}"
LABEL org.opencontainers.image.version="${IMAGE_VERSION}"
LABEL org.opencontainers.image.revision="${VCS_REF}"
LABEL org.opencontainers.image.base.name="ubuntu:noble-20240530"
LABEL org.opencontainers.image.licenses="MIT"
WORKDIR ${SALT_HOME}
ENTRYPOINT [ "/sbin/entrypoint.sh" ]
CMD [ "app:start" ]