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

ARM64 support #5

Open
wants to merge 5 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
51 changes: 30 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
FROM alpine as ngrok
FROM alpine as ngrok
ARG TARGETPLATFORM

RUN apk add --no-cache --virtual .bootstrap-deps ca-certificates && \
wget -O /tmp/ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip && \
unzip -o /tmp/ngrok.zip -d / && \
apk del .bootstrap-deps && \
rm -rf /tmp/* && \
rm -rf /var/cache/apk/*
RUN apk add --no-cache --virtual .bootstrap-deps ca-certificates

FROM busybox:glibc
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi && \
wget -O /tmp/ngrok.tgz "https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-${ARCHITECTURE}.tgz" && \
tar -xvzf /tmp/ngrok.tgz

LABEL maintainer="Dmitry Shkoliar @shkoliar"

COPY --from=ngrok /ngrok /bin/ngrok
COPY start.sh /

RUN mkdir -p /home/ngrok /home/ngrok/.ngrok2 && \
printf 'web_addr: 0.0.0.0:4551' > /home/ngrok/.ngrok2/ngrok.yml && \
addgroup -g 4551 -S ngrok && \
adduser -u 4551 -S ngrok -G ngrok -h /home/ngrok -s /bin/ash && \
chown -R ngrok:ngrok /home/ngrok && \
chmod +x /start.sh
RUN apk del .bootstrap-deps

USER ngrok:ngrok
RUN rm -rf /tmp/*

EXPOSE 4551
RUN rm -rf /var/cache/apk/*

ENTRYPOINT ["/start.sh"]


FROM busybox:glibc

LABEL maintainer="Dmitry Shkoliar @shkoliar"

COPY --from=ngrok /ngrok /bin/ngrok
COPY start.sh /

RUN mkdir -p /home/ngrok /home/ngrok/.ngrok2 && \
printf 'web_addr: 0.0.0.0:4551' > /home/ngrok/.ngrok2/ngrok.yml && \
addgroup -g 4551 -S ngrok && \
adduser -u 4551 -S ngrok -G ngrok -h /home/ngrok -s /bin/ash && \
chown -R ngrok:ngrok /home/ngrok && \
chmod +x /start.sh

USER ngrok:ngrok

EXPOSE 4551

ENTRYPOINT ["/start.sh"]
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
CMD="$CMD $PROTOCOL"

if [[ -n "$REGION" ]]; then
CMD="$CMD -region=$REGION"
CMD="$CMD --region=$REGION"
fi

if [[ -n "$HOST_HEADER" ]]; then
Expand Down