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

Rebase on Google Distroless - Java #22

Open
wants to merge 7 commits into
base: nxfilter-debian
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
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
5 changes: 3 additions & 2 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ name: Fetch and Compare NxFilter version

on:
schedule:
- cron: '0 0 * * *'
- cron: '0 13 * * *'

# push:
# branches: [ nxfilter-pi-experimental ]
# pull_request:
Expand All @@ -32,7 +33,7 @@ jobs:
- name: Push back to branch
uses: Automattic/action-commit-to-branch@master
with:
branch: 'nxfilter-debian'
branch: 'nxfilter-debian-experimental'
commit_message: 'GitHub Actions update version.txt'
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ jobs:
file: ./Dockerfile
platforms: linux/amd64,linux/386,linux/arm/v7,linux/arm/v6,linux/arm64/v8
push: true
tags: packetworks/nxfilter-base:debian
tags: packetworks/nxfilter-base:debian-experimental
labels: ${{ steps.docker_meta.outputs.labels }}
56 changes: 37 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
FROM debian
FROM debian AS builder

MAINTAINER Charles Gunzelman
LABEL org.label-schema.docker.dockerfile="/Dockerfile" \
org.label-schema.vcs-type="Git" \
org.label-schema.vcs-url="https://github.com/packetworks/docker-nxfilter"
ENV container docker

# Include the SSL-Split binary, not used by default.
COPY --from=vimagick/sslsplit /usr/local/bin/sslsplit /usr/local/bin/

RUN apt -y update \
RUN apt -y update \
&& apt -y upgrade \
&& apt -y install wget unzip default-jre-headless libtcnative-1 libapr1 libapr1-dev \
&& apt -y clean autoclean \
&& apt -y autoremove \
&& rm -rf /var/lib/apt && rm -rf /var/lib/dpkg && rm -rf /var/lib/cache && rm -rf /var/lib/log
&& apt -y install wget unzip libtcnative-1 libapr1 libapr1-dev

# Populate ingredients from Git repo.
COPY entrypoint.sh url.txt /
COPY url.txt /

# Download and unzip nxfilter
# Download and unzip nxfilter from nxfilter.org
RUN wget -nv -i url.txt -O nxfilter.zip \
&& mkdir /nxfilter \
&& unzip nxfilter.zip -d /nxfilter \
&& chmod +x /nxfilter/bin/startup.sh \
&& unzip -q nxfilter.zip -d /nxfilter \
&& rm -f nxfilter.zip

ENTRYPOINT ["/entrypoint.sh"]
CMD ["/nxfilter/bin/startup.sh"]

########
########

FROM gcr.io/distroless/java:8

MAINTAINER Charles Gunzelman
LABEL org.label-schema.docker.dockerfile="/Dockerfile" \
org.label-schema.vcs-type="Git" \
org.label-schema.vcs-url="https://github.com/packetworks/docker-nxfilter"

# Deconstruct startup.sh
ENV container=docker \
PATH=$PATH:/usr/bin:/usr/local/bin \
CLASSPATH=$NX_HOME/nxd.jar:$NX_HOME/lib/*: \
NX_HOME=/

# Include SSL-Split binary, not used by default.
COPY --from=vimagick/sslsplit /usr/local/bin/sslsplit /usr/local/bin/

# Copy packages from Builder.
# COPY --from=builder /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ #got an error with this one at build time
COPY --from=builder /usr/share/lintian/overrides /usr/share/lintian/overrides
COPY --from=builder /usr/bin/apr-1-config /usr/bin/apr-config /usr/bin/
COPY --from=builder /usr/include/apr-1.0 /usr/include/apr-1.0
COPY --from=builder /nxfilter /
COPY --from=builder /bin/hostname /bin/

# Deconstruct startup.sh
ENTRYPOINT ["java"]
CMD [ "-Djava.net.preferIPv4Stack=true", "-Xmx768m", "-Djava.security.egd=file:/dev/./urandom", "nxd.Main" ]