First commit

This commit is contained in:
Git Commiter for 96-fromsofia.net 2023-02-27 01:39:33 +00:00
commit 7e5432260d
4 changed files with 66 additions and 0 deletions

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
# Get the latest alpine build
FROM alpine:latest
# Copy the xcookie to your container to use for your X session
# This line can be removed if not intended to be used on Desktop with GUI
COPY xcookie /tmp/
# Add the necessary packages
# Can remove xauth, st, xclid and ttf-liberation if not intended to be used on Desktop with GUI
RUN apk add xauth st xclip gnupg pass ttf-liberation
# Add the user to start your app
# Can skip adding your user to the video group if not intended to be used on Desktop with GUI
RUN adduser pass -D ; addgroup pass pass ; addgroup pass video
# Add the xcookie to the session of the user we just created
RUN su -c "xauth add $(cat /tmp/xcookie)" pass
# Use the user we just configured
USER pass
# Start it all
# This line can be chanhed to: 'CMD /bin/sh' if not intended to be used on Desktop with GUI
CMD st

29
README.txt Normal file
View File

@ -0,0 +1,29 @@
# 1) Go into the source directory of this app 'pass' and copy it into your docker environment:
# You can use your own path but will need to adjust the below lines and any affected dependant files accordingly
$ cp . /var/lib/docker/configs/pass/
$ cd /var/lib/docker/configs/pass/
# 2) Configure the host environment for the container before starting it
# - If intended to be used on Desktop as GUI:
# *) run 'xauth list' on the Docker host as the user that will run the container (not root, unless root runs X on your system)
# *) copy the whole line that was produced by the above command and save it into the xcookie in the source directory of this app
# - If not intended to be run in GUI:
# *) remove the xcookie file from the source directory of this app
# *) edit the Docker file accordingly (see comments in Dockerfile)
# *) remove the below lines from the 'start-pass' script found in the source directory of this app
# -v /tmp/.X11-unix \
# -e DISPLAY=$DISPLAY \
# 3) Build your container
$ docker build -t . pass
# 4) Create the below directories within /var/lib/docker/configs/pass/data
# If using a different path to store your containers configurations and data files you will need to modify the paths in the 'start-pass' script too
$ mkdir -p /var/lib/docker/configs/pass/data/{gnupg,password-store}
# 5) Start your container with:
$ start-pass
# 6) Optionally you can move the start-pass script somewhere inside of your path
$ sudo cp start-pass /usr/loca/bin
$ sudo chmod -v 0755 /usr/loca/bin/start-pass

11
start-pass Executable file
View File

@ -0,0 +1,11 @@
docker run --rm -it \
--memory "512m" \
--cpus ".5" \
--net=host \
# the below line can be removed if not intended to be used on Desktop
-v /tmp/.X11-unix \
-v /var/lib/docker/configs/pass/data/gnupg:/home/pass/.gnupg \
-v /var/lib/docker/configs/pass/data/password-store:/home/pass/.password-store \
# the below line can be removed if not intended to be used on Desktop
-e DISPLAY=$DISPLAY \
pass

2
xcookie Normal file
View File

@ -0,0 +1,2 @@