Skip to content
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
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.7-slim

ENV PATH="~/.local/bin:${PATH}"
ENV PATH="/home/testuser/.local/bin:${PATH}"

#Mirror host user
#Efficently mirror host user and share files between host and docker
#https://stackoverflow.com/a/44683248/298240
ARG UNAME=testuser
ARG UID=1000
ARG GID=1000
#FIXES https://stackoverflow.com/a/63377623/298240
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 python3-opencv sudo && groupadd -g $GID -o $UNAME && useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME && echo "testuser:testuser" | chpasswd && adduser testuser sudo
USER $UNAME
WORKDIR /home/$UNAME/workspace
RUN pip install --upgrade h5py==2.10.0 fawkes opencv-python
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ pip install fawkes

If you don't have root privilege, please try to install on user namespace: `pip install --user fawkes`.

## Installation and Usage with Docker

- On your host machine move or copy your images folder to your normal workspace directory `cd ~/workspace`
- clone this repository: `git clone [url]` into your normal workspace directory
- go into cloned repository: `cd fawkes`
- run `buildDocker.sh`
- run `startDocker.sh`
- You should now be in the fawkes container with your normal workspace directory to /home/testuser/workspace
- You can then run fawkes with something like: e.g. `fawkes -d ./imgs --mode=low`
- exit from your container: `exit`

Academic Research Usage
-----------------------
Expand Down
5 changes: 5 additions & 0 deletions buildDocker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Pass in user id's for mirroring host user
docker build \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
-t fawkes .
2 changes: 2 additions & 0 deletions startDocker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Map Parrent directory to workspace folder under home directory
docker run -it -v "$(pwd)/..:/home/testuser/workspace" fawkes bash