Last active
October 6, 2022 00:29
-
-
Save hhff/5d6a40187bdbcc5ac8bbfe738bc817fc to your computer and use it in GitHub Desktop.
Urbit Alpine with optional swapfile setup
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
FROM alpine:latest | |
EXPOSE 80/tcp | |
EXPOSE 34343/udp | |
COPY ./bin/start-urbit /bin/start-urbit | |
COPY ./bin/get-urbit-code /bin/get-urbit-code | |
COPY ./bin/reset-urbit-code /bin/reset-urbit-code | |
RUN apk add --no-cache curl bash libcap libc6-compat | |
RUN cd /bin && curl -L https://urbit.org/install/linux64/latest | tar xzk --strip=1 | |
RUN setcap 'cap_net_bind_service=+ep' /bin/urbit | |
RUN mkdir -p /urbit | |
RUN mkdir -p /tmp | |
WORKDIR /urbit | |
CMD if [[ ! -z "$SWAP" ]]; then fallocate -l $(($(stat -f -c "(%a*%s/10)*7" .))) _swapfile && mkswap _swapfile && swapon _swapfile && ls -hla; fi; free -m; /bin/start-urbit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment