-
-
Save bootstraponline/d3845e77532e3eb9d77d41b15adfa565 to your computer and use it in GitHub Desktop.
Dockerfile for running keybase in a container... requires KEYBASEUSER.ss config.json secretkeys.KEYBASEUSER.mpack session.json in the same directory as the Dockerfile... also, if you ever logout, the session.json will change.
This file contains hidden or 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 ubuntu:16.04 | |
MAINTAINER Jonathan Underwood | |
# set env vars for linux user and keybase user | |
ENV LINUX_USER="kbuser" \ | |
KEYBASE_USER="youruser" | |
# use curl to grab the latest build from keybase.io | |
RUN apt update && apt install -y \ | |
curl | |
# make a user to run it | |
RUN adduser --disabled-password --gecos "" $LINUX_USER | |
# download the deb and install. exit 0 is to prevent build errors. | |
WORKDIR /home/$LINUX_USER | |
RUN curl -O https://prerelease.keybase.io/keybase_amd64.deb | |
RUN dpkg -i keybase_amd64.deb; exit 0 | |
# install dependencies | |
RUN apt install -f -y | |
# need to mkdir with kbuser | |
USER kbuser | |
RUN mkdir -p /home/$LINUX_USER/.cache/keybase/; \ | |
mkdir -p /home/$LINUX_USER/.config/keybase/; \ | |
mkdir -p /home/$LINUX_USER/.local/share/keybase/ | |
# return to root | |
USER root | |
# Copy the four files for the user session | |
COPY session.json /home/$LINUX_USER/.cache/keybase/session.json | |
COPY config.json /home/$LINUX_USER/.config/keybase/config.json | |
COPY secretkeys.$KEYBASE_USER.mpack /home/$LINUX_USER/.config/keybase/secretkeys.$KEYBASE_USER.mpack | |
COPY $KEYBASE_USER.ss /home/$LINUX_USER/.local/share/keybase/$KEYBASE_USER.ss | |
# Make sure they are chowned and chmodded correctly | |
RUN chown kbuser:kbuser /home/$LINUX_USER/.cache/keybase/session.json; \ | |
chown kbuser:kbuser /home/$LINUX_USER/.config/keybase/config.json; \ | |
chown kbuser:kbuser /home/$LINUX_USER/.config/keybase/secretkeys.$KEYBASE_USER.mpack; \ | |
chown kbuser:kbuser /home/$LINUX_USER/.local/share/keybase/$KEYBASE_USER.ss; \ | |
chmod 0600 /home/$LINUX_USER/.cache/keybase/session.json; \ | |
chmod 0600 /home/$LINUX_USER/.config/keybase/config.json; \ | |
chmod 0600 /home/$LINUX_USER/.config/keybase/secretkeys.$KEYBASE_USER.mpack; \ | |
chmod 0600 /home/$LINUX_USER/.local/share/keybase/$KEYBASE_USER.ss | |
# Finally run run_keybase to set up all the initial files and you will be logged in | |
USER $LINUX_USER | |
RUN run_keybase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment