Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile #381

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# build by: docker build -t sniproxy .
#

FROM ubuntu:20.04 AS builder

ENV DEBIAN_FRONTEND noninteractive

# Build Stage
RUN apt-get update && \
apt-get install -y \
autotools-dev \
cdbs \
debhelper \
dh-autoreconf \
dpkg-dev \
gettext \
libev-dev \
libpcre3-dev \
libudns-dev \
pkg-config \
fakeroot \
devscripts && \
mkdir -p /sniproxy

COPY . /sniproxy/

RUN cd /sniproxy && \
./autogen.sh && \
dpkg-buildpackage



# Usage
FROM ubuntu:20.04

COPY --from=builder /*.deb /tmp/

RUN apt-get update && \
apt install -y --no-install-recommends /tmp/sniproxy_*.deb && \
rm -f /tmp/sniproxy_*.deb

ENTRYPOINT ["sniproxy", "-f"]
EXPOSE 80 443
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Features
+ Supports HAProxy proxy protocol to propagate original source address to
backend servers.

Usage
Usage: Binary
-----

Usage: sniproxy [-c <config>] [-f] [-n <max file descriptor limit>] [-V]
Expand All @@ -26,6 +26,16 @@ Usage
-n specify file descriptor limit
-V print the version of SNIProxy and exit

Usage: Docker
-----

docker build -t sniproxy .

docker run \
-it \
--network host \
--volume /etc/sniproxy.conf:/etc/sniproxy.conf:ro \
sniproxy:latest -c /etc/sniproxy.conf

Installation
------------
Expand Down