This commit is contained in:
2019-04-14 19:34:54 +02:00
commit eeeae624e4
5 changed files with 118 additions and 0 deletions

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM fedora
LABEL maintainer="Jens Kleineheismann <heinzel@heinzelwelt.de>"
RUN dnf -y update && \
dnf -y install procps-ng iproute net-tools && \
dnf -y install haproxy && \
dnf clean all
COPY container-filesystem/ /
EXPOSE 80/tcp
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["--"]

30
Makefile Normal file
View File

@@ -0,0 +1,30 @@
APPLICATION_NAME := haproxy
IMAGE_NAME := $(APPLICATION_NAME)
HOST_PORT := 80
CONTAINER_PORT := 80
DOCKER := docker
DGOSS := dgoss
GIT := git
.PHONY: default help image test test-run enter
default: image
help:
@echo "There is no help."
$(IMAGE_NAME):
$(DOCKER) build -t $(IMAGE_NAME) .
image: $(IMAGE_NAME)
test:
$(DGOSS) run $(IMAGE_NAME)
test-run:
$(DOCKER) run -ti --rm -p $(HOST_PORT):$(CONTAINER_PORT) $(IMAGE_NAME)
enter:
$(DOCKER) run -ti --rm -p $(HOST_PORT):$(CONTAINER_PORT) --entrypoint /bin/bash $(IMAGE_NAME)

54
README.rst Normal file
View File

@@ -0,0 +1,54 @@
ABOUT
=====
Docker container for HA-Proxy.
AUTHOR
======
Jens Kleineheismann <heinzel@heinzelwelt.de>
DESCRIPTION
===========
This docker image is derivated from the official Fedora image
(https://hub.docker.com/_/fedora).
It will contain and run
- haproxy
BUILD
=====
- ``make``
- ``make test``
or alternatively the *long* way:
- ``docker build -t haproxy .``
- ``dgoss run haproxy``
USAGE
=====
- ``docker run -d -p 80:80 haproxy``
The httpd process is listening on port 80/tcp.
The httpd error log will be written to stderr, so it can be
obtained with ``docker logs``
CONFIGURATION
=============
The following **environment variables** are supported and
can be set with the -e option of the ``docker run`` command:
- LOG_LEVEL (default: error)
-- to set the httpd LogLevel directive
LICENCE
=======
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted.

View File

@@ -0,0 +1,10 @@
#!/bin/sh
# Remove left-overs from an incomplete shutdown previously.
rm -rf /run/httpd/* /tmp/httpd*
exec /usr/sbin/httpd \
-DFOREGROUND \
-c "LogLevel ${LOG_LEVEL:-error}" \
-c "ServerName ${HOSTNAME}" \
"$@"

View File

@@ -0,0 +1,9 @@
# /etc/bashrc.local
PS1='\u@\w/ \$ '
export PS1
alias ls="ls -F --color"
alias l="ls -ahl"
#end