构建haproxy镜像(基于alpine系统)

本文介绍了如何从alpine系统镜像开始,编写Dockerfile来构建Haproxy镜像,并配置启动脚本和安装过程。涉及了环境变量设置、文件复制、软件安装和配置文件生成。

拉取alpine系统镜像

[root@localhost ~]# docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
Digest: sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300
Status: Image is up to date for alpine:latest
docker.io/library/alpine:latest

[root@localhost docker]# tree haproxy/
haproxy/
├── conf
│   └── RSS
├── Dockerfile
└── files
    ├── entrypoint.sh
    ├── haproxy-2.4.9.tar.gz
    ├── haproxy.cfg
    ├── install.sh

编写dockerfile

[root@localhost docker]# vim haproxy/Dockerfile 
FROM alpine
  
LABEL MAINTAINER='neawalke 123456789@qq.com'

ENV version 2.4.9
ENV PATH /usr/local/harpoxy/sbin:$PATH

ADD files/haproxy-${version}.tar.gz /tmp/
ADD files/install.sh /tmp/
COPY files/entrypoint.sh /


RUN /tmp/install.s
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值