Skip to content

Commit

Permalink
Update Dockerfile to use Python3.6 and install from PyPI package
Browse files Browse the repository at this point in the history
Also update README and CONTRIBUTING guides with the information
on how to build and run Docker image.
  • Loading branch information
balta2ar committed Jun 9, 2018
1 parent 26d6d33 commit ef32686
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,21 @@ DRAFT
I think this is required for PyPI description to look nice.
7. `python setup.py sdist` to build the package
8. `twine upload dist/coursera-dl-0.6.1.tar.gz` to deploy the package.

## Docker

Build new Docker image from PyPI package:

```
docker build --tag courseradl/courseradl --build-arg VERSION=0.11.2 .
```

Run the image:
```
docker run --rm -it -v "$(pwd):/courses" -v "$HOME/.netrc:/netrc" courseradl -n /netrc -- google-machine-learning
```

Publish the image:
```
docker push courseradl/courseradl
```
15 changes: 4 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
FROM python:3.4-slim
FROM python:3.6-slim

LABEL maintainer "[email protected]"

WORKDIR /src
COPY requirements.txt /src

COPY requirements-dev.txt /src
LABEL maintainer "https://github.com/coursera-dl/"

RUN apt-get update && \
apt-get install -y --no-install-recommends gcc g++ libssl-dev && \
rm -rf /var/lib/apt/lists/* && \
pip install -r requirements.txt && \
pip install -r requirements-dev.txt && \
apt-get purge -y --auto-remove gcc g++ libssl-dev

COPY . /src
RUN python setup.py install
ARG VERSION
RUN pip install coursera-dl==$VERSION

WORKDIR /courses
ENTRYPOINT ["coursera-dl"]
Expand Down
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,27 +219,38 @@ applicable).

If you prefer you can run this software inside Docker:

```
docker run --rm -it -v \
"$(pwd):/courses" \
courseradl/courseradl -u <USER> -p <PASSWORD>
```

Or using netrc file:

```
docker run --rm -it \
-v "$(pwd):/courses" \
strm/coursera-dl \
-u <USER> -p <PASSWORD>
-v "$(pwd):/courses" -v "$HOME/.netrc:/netrc" \
courseradl/courseradl -n /netrc
```

The actual working dir for coursera-dl is /courses, all courses will be downloaded there if you don't specify otherwise.
The actual working dir for coursera-dl is /courses, all courses will be
downloaded there if you don't specify otherwise.

## Windows

`python -m pip install coursera-dl`

Be sure that the Python install path is added to the PATH system environment variables. This can be found in Control Panel > System > Advanced System Settings > Environment Variables.
Be sure that the Python install path is added to the PATH system environment
variables. This can be found in Control Panel > System > Advanced System
Settings > Environment Variables.

```
Example:
C:\Python35\Scripts\;C:\Python35\;
```

Or if you have restricted installation permissions and you've installed Python under AppData, add this to your PATH.
Or if you have restricted installation permissions and you've installed Python
under AppData, add this to your PATH.

```
Example:
Expand Down

0 comments on commit ef32686

Please sign in to comment.