From 0c72a9b27933c9b02626451c6a0acfa8efc9bf90 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 09 2017 09:48:56 +0000 Subject: [PATCH 1/2] Create a local user within the docker container The idea is that we are mounting the ssh keys from the user running the container into the container and in Fedora, that user will have the UID 1000, so these keys won't be available inside the container which is by default ran as root. So let's create a local user within the container, it will have the UID 1000 and thus mounting the ssh keys will work. Note that this will not work if the user running the container does not have the same UID. --- diff --git a/Dockerfile b/Dockerfile index d54779c..62e987b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,4 +5,6 @@ RUN dnf install -y dnf-plugins-core && \ dnf copr enable -y cverna/pagure-importer && \ dnf install -y python3-pgimport +RUN adduser -m duser + ENV LC_ALL=en_GB.UTF-8 From 4cd6618eb949b4ba329e36ef1f7c21e02e6a6255 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 09 2017 09:51:03 +0000 Subject: [PATCH 2/2] Adjust the docker run command The order of the argument matters (-v first, -i -t then) and provide the tag built with and to run as otherwise the -t argument is not used. --- diff --git a/README.md b/README.md index 69848ca..53b4b5d 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ CLI tool for importing issues etc. from different sources like github to pagure #### Using Docker * Build and run a container using the Dockerfile in this repository ``` - $ docker build -t pgimport . - $ docker run -t -i -v ~/.ssh/:/root/.ssh/:Z /bin/bash + $ sudo docker build -t pgimport . + $ sudo docker run -v ~/.ssh/:/home/duser/.ssh/:Z -i -t pgimport /bin/bash ``` * Inside the container you can use the pgimport command.