Skip to content

Commit

Permalink
Merge pull request #71 from alrs/docker
Browse files Browse the repository at this point in the history
Docker Support
  • Loading branch information
Bogdan Sala authored Feb 14, 2019
2 parents 861e5ad + b75a808 commit 4ef39a2
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,9 @@ dmypy.json

# vim swap
.swp

# requirements.txt copy used for Docker
docker/requirements.txt

# ignore images Docker helper directory
images/*
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
.PHONY: default pycodestyle clean
.PHONY: default pycodestyle clean docker help

default: tags pycodestyle
default: help

help:
@echo 'tags: Build ctags'
@echo 'pycodestyle: run pycodestyle (pep8)'
@echo 'docker: build docker containter'
@echo 'clean: remove development and docker debris'

tags: *.py
ctags ./
Expand All @@ -9,4 +15,11 @@ pycodestyle:
pycodestyle --max-line-length=100 ./

clean:
rm tags
if [ -f tags ] ; then rm tags; fi
if [ -f docker/requirements.txt ]; then rm docker/requirements.txt; fi

docker/requirements.txt:
cp requirements.txt docker/requirements.txt

docker: docker/requirements.txt
docker build -t osc-up docker
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,12 @@ python osc_tools.py generate_exif -h
python osc_tools.py generate_exif -p ~/OSC_seqences/Sequence1
```

##### Docker
To run the scripts inside a Docker container:
```
make docker
docker run -Pit osc-up osc_tools.py
docker run -Pit --mount type=bind,source="$(pwd)",target=/opt/osc osc-up /opt/osc/osc_tools.py
```
The images directory in the repo will be available in the container at /opt/osc/images
7 changes: 7 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:buster-slim

COPY requirements.txt /etc/requirements.txt
COPY git-blacklist /etc/apt/preferences.d/git-blacklist

RUN apt-get update && apt-get -y upgrade && apt-get -y install python3 python3-pip && pip3 install -r /etc/requirements.txt && apt-get -y clean

3 changes: 3 additions & 0 deletions docker/git-blacklist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Package: git
Pin: release *
Pin-Priority: -1
2 changes: 2 additions & 0 deletions images/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a directory ignored by git that exists to help easily mount an image
directory along with the upload-scripts code to a Docker container.
2 changes: 1 addition & 1 deletion osc_discoverer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""This script is used to discover video files, sensor info and return Sequences."""
import os
import json
Expand Down
2 changes: 1 addition & 1 deletion osc_tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""Tools developed by OpenStreetCam to help contributors."""

import logging
Expand Down
2 changes: 1 addition & 1 deletion visual_data_discover.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""This script is used to discover video files, or photo files"""

import os
Expand Down

0 comments on commit 4ef39a2

Please sign in to comment.