Skip to content

Commit

Permalink
Merge pull request #47 from threadproc/amzn2-docker-build
Browse files Browse the repository at this point in the history
Add Amazon Linux 2 Docker build
thanks for the contrib @threadproc merged it.
  • Loading branch information
DBezemer authored Apr 23, 2022
2 parents fcac8ad + 805f947 commit c045311
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile-amzn2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM amazonlinux:2

RUN yum install -y pcre-devel make gcc openssl-devel rpm-build systemd-devel curl sed zlib-devel
RUN mkdir RPMS
RUN chmod -R 777 RPMS
RUN mkdir SPECS
RUN mkdir SOURCES
COPY Makefile Makefile
COPY SPECS/haproxy.spec SPECS/haproxy.spec
COPY SOURCES/* SOURCES/

CMD make NO_SUDO=1 && cp /rpmbuild/RPMS/x86_64/* /RPMS && cp /rpmbuild/SRPMS/* /RPMS
2 changes: 2 additions & 0 deletions Dockerfile8
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM centos:8

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
RUN yum install -y pcre-devel make gcc openssl-devel rpm-build systemd-devel curl sed zlib-devel
RUN mkdir RPMS
RUN chmod -R 777 RPMS
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ endif
build-docker:
docker build -t haproxy-rpm-builder7:${VERSION}-${RELEASE} -f Dockerfile7 .
docker build -t haproxy-rpm-builder8:${VERSION}-${RELEASE} -f Dockerfile8 .
docker build -t haproxy-rpm-builder-amzn2:${VERSION}-${RELEASE} -f Dockerfile-amzn2 .

run-docker: build-docker
mkdir -p RPMS
chcon -Rt svirt_sandbox_file_t RPMS || true
docker run --volume $(HOME)/RPMS:/RPMS --rm haproxy-rpm-builder7:${VERSION}-${RELEASE}
docker run --volume $(HOME)/RPMS:/RPMS --rm haproxy-rpm-builder8:${VERSION}-${RELEASE}
docker run --volume $(HOME)/RPMS:/RPMS --rm haproxy-rpm-builder-amzn2:${VERSION}-${RELEASE}

build: $(build_stages)
cp -r ./SPECS/* ./rpmbuild/SPECS/ || true
Expand Down
3 changes: 3 additions & 0 deletions SPECS/haproxy.spec
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ fi
%endif

%changelog
* Thu Feb 10 2022 Kai Parry <[email protected]>
- Add Docker support for Amazon Linux 2

* Sat May 30 2021 David Bezemer <[email protected]>
- Add support for HAProxy 2.4.x

Expand Down

0 comments on commit c045311

Please sign in to comment.