-
Notifications
You must be signed in to change notification settings - Fork 6
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
Some code refactoring for the dockerfiles. #14
Open
beardstack
wants to merge
11
commits into
oxen-io:main
Choose a base branch
from
beardstack:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f6d9dfb
Refactoring Dockerfile to optimize build time, reduce build layers an…
beardstack 0b814db
Refactoring Dockerfile to optimize build time, reduce build layers an…
beardstack b55522f
Refactoring Dockerfile to optimize build time, reduce build layers an…
beardstack 5f755f9
Update lokinet/lokinet-exit.dockerfile
beardstack 7898d6e
use 755 for permissions
majestrate 7b895b3
use 755 for permissions
majestrate 6d1b716
More tweaks
beardstack 583e4dc
More tweaks
beardstack 46f8af1
Code analysis and questions
beardstack 7794947
Merge branch 'oxen-io:main' into main
beardstack ffa0b06
Merge branch 'oxen-io:main' into main
beardstack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#What is this ip? | ||
[network] | ||
auth=lmq | ||
auth-lmq=tcp://10.0.3.1:5555 | ||
auth-lmq=tcp://10.0.3.1:5555 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# This file can become redundant when using compose. | ||
# sysctls: | ||
# - net.ipv4.ip_forward=1 | ||
# - net.ipv6.conf.all.forwarding=1 | ||
# | ||
|
||
|
||
# ip forwarding allowed | ||
net.ipv4.ip_forward=1 | ||
net.ipv6.conf.all.forwarding=1 | ||
net.ipv6.conf.all.forwarding=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#What is the purpose of this file? | ||
|
||
[network] | ||
keyfile=/data/nginx.private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# what is the purpose of the lokinet-addr.txt file? | ||
# what process uses it? | ||
|
||
#!/bin/bash | ||
print-lokinet-address.sh > /data/lokinet-addr.txt | ||
chmod 444 /data/lokinet-addr.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
FROM debian:stable AS lokinet-base | ||
#use argument instead of lsb-release | ||
ARG DEBIAN_RELEASE=bullseye | ||
|
||
FROM debian:${DEBIAN_RELEASE}-slim AS lokinet-base | ||
ENV container docker | ||
|
||
ENV RELEASE=${DEBIAN_RELEASE:-bullseye} | ||
#Add oxen public key | ||
ADD --chmod=644 --chown=_apt https://deb.oxen.io/pub.gpg /etc/apt/trusted.gpg.d/lokinet.gpg | ||
|
||
# set up packages | ||
RUN /bin/bash -c 'echo "man-db man-db/auto-update boolean false" | debconf-set-selections' | ||
RUN /bin/bash -c 'apt-get -o=Dpkg::Use-Pty=0 -q update && apt-get -o=Dpkg::Use-Pty=0 -q dist-upgrade -y && apt-get -o=Dpkg::Use-Pty=0 -q install -y --no-install-recommends ca-certificates curl iptables dnsutils lsb-release systemd systemd-sysv cron conntrack iproute2 python3-pip wget' | ||
RUN /bin/bash -c 'curl -so /etc/apt/trusted.gpg.d/lokinet.gpg https://deb.oxen.io/pub.gpg' | ||
RUN /bin/bash -c 'echo "deb https://deb.oxen.io $(lsb_release -sc) main" > /etc/apt/sources.list.d/lokinet.list' | ||
RUN /bin/bash -c 'apt-get -o=Dpkg::Use-Pty=0 -q update && apt-get -o=Dpkg::Use-Pty=0 -q dist-upgrade -y && apt-get -o=Dpkg::Use-Pty=0 -q install -y --no-install-recommends lokinet' | ||
RUN DEBIAN_FRONTEND=noninteractive \ | ||
&& echo "deb https://deb.oxen.io ${RELEASE} main" > /etc/apt/sources.list.d/lokinet.list \ | ||
&& echo "man-db man-db/auto-update boolean false" | debconf-set-selections \ | ||
&& apt-get update -y \ | ||
&& apt-get dist-upgrade -y \ | ||
&& apt-get install -y --no-install-recommends ca-certificates iptables dnsutils systemd systemd-sysv cron conntrack iproute2 \ | ||
&& apt-get update -y \ | ||
&& apt-get install -y --no-install-recommends lokinet \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
majestrate marked this conversation as resolved.
Show resolved
Hide resolved
|
||
&& mkdir -p /var/lib/lokinet/conf.d \ | ||
&& mkdir /data && chown _lokinet:_loki /data | ||
|
||
# make config dir for lokinet | ||
RUN /bin/bash -c 'mkdir -p /var/lib/lokinet/conf.d' | ||
# set up private data dir for lokinet | ||
RUN /bin/bash -c 'mkdir /data && chown _lokinet:_loki /data' | ||
|
||
# print lokinet util | ||
COPY contrib/print-lokinet-address.sh /usr/local/bin/print-lokinet-address.sh | ||
RUN /bin/bash -c 'chmod 700 /usr/local/bin/print-lokinet-address.sh' | ||
COPY --chmod=755 contrib/print-lokinet-address.sh /usr/local/bin/print-lokinet-address.sh | ||
|
||
# dns | ||
COPY contrib/lokinet.resolveconf.txt /etc/resolv.conf | ||
RUN /bin/bash -c 'chmod 644 /etc/resolv.conf' | ||
COPY --chmod=644 contrib/lokinet.resolveconf.txt /etc/resolv.conf | ||
|
||
STOPSIGNAL SIGRTMIN+3 | ||
ENTRYPOINT ["/sbin/init", "verbose", "systemd.unified_cgroup_hierarchy=0", "systemd.legacy_systemd_cgroup_controller=0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM registry.oxen.rocks/lokinet-exit:latest | ||
|
||
RUN /bin/bash -c 'ln -s /var/lib/lokinet/conf.d/custom.ini /data/custom.ini' | ||
RUN ln -s /var/lib/lokinet/conf.d/custom.ini /data/custom.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
FROM registry.oxen.rocks/lokinet-base:latest | ||
|
||
RUN /bin/bash -c 'apt-get -o=Dpkg::Use-Pty=0 -q update && apt-get -o=Dpkg::Use-Pty=0 -q dist-upgrade -y && apt-get -o=Dpkg::Use-Pty=0 -q install -y --no-install-recommends nginx' | ||
RUN DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get update -y \ | ||
&& apt-get dist-upgrade -y \ | ||
&& apt-get install -y --no-install-recommends nginx | ||
|
||
# set up configs for lokinet nginx | ||
COPY contrib/lokinet-nginx.ini /var/lib/lokinet/conf.d/nginx.ini |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make separate issues for each of these questions instead of in a git commit on a PR so they are tracked and we can close them as they get addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I figured out a number of things on my own but I'm not sure how to close the PR - Please do if you can.