1 Star 0 Fork 0

neverland-lab/saltstack-service

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Dockerfile 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
小埋酱 提交于 2024-05-10 16:11 . up
# 使用官方的Ubuntu作为基础镜像
FROM ubuntu:22.04
# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
# 安装需要的包
RUN apt-get update && apt-get install -y supervisor net-tools curl vim jq binutils build-essential patchelf
# 添加Salt Stack的源
RUN curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2023.gpg https://repo.saltproject.io/salt/py3/ubuntu/22.04/amd64/SALT-PROJECT-GPG-PUBKEY-2023.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=amd64] https://repo.saltproject.io/salt/py3/ubuntu/22.04/amd64/latest jammy main" | tee /etc/apt/sources.list.d/salt.list
# 安装Salt Stack
RUN apt-get update && apt-get install -y \
salt-master salt-minion salt-ssh salt-syndic salt-cloud salt-api \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# 创建必要的文件夹
RUN mkdir -p /srv/salt
# 将当前目录的内容复制到容器的/app目录
ADD ./config/salt/master /etc/salt/master
ADD ./config/salt/minion /etc/salt/minion
ADD ./config/supervisor/salt-master.conf /etc/supervisor/conf.d/salt-master.conf
ADD ./config/supervisor/salt-api.conf /etc/supervisor/conf.d/salt-api.conf
RUN /opt/saltstack/salt/bin/pip install psycopg2-binary sqlalchemy records
# 设置挂载点
VOLUME ["/etc/salt","/var/log/salt","/var/cache/salt","/srv/salt","/srv/pillar"]
# 设置开放端口
EXPOSE 4505 4506
# 创建新用户
RUN useradd -M -s /sbin/nologin saltapi
RUN echo "saltapi:Changeme" | chpasswd
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
WORKDIR /
# 定义容器启动命令
CMD [ "supervisord","-n" ]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/neverland-lab/saltstack-service.git
[email protected]:neverland-lab/saltstack-service.git
neverland-lab
saltstack-service
saltstack-service
main

搜索帮助