pull/90/head
Chris Holdgraf 2017-10-06 17:43:31 -07:00 zatwierdzone przez Chris Holdgraf
rodzic 56870a3a6c
commit 8825413feb
3 zmienionych plików z 897 dodań i 892 usunięć

204
README.md
Wyświetl plik

@ -1,102 +1,102 @@
# jupyter-repo2docker # jupyter-repo2docker
[![Build Status](https://travis-ci.org/jupyter/repo2docker.svg?branch=master)](https://travis-ci.org/jupyter/repo2docker) [![Build Status](https://travis-ci.org/jupyter/repo2docker.svg?branch=master)](https://travis-ci.org/jupyter/repo2docker)
**jupyter-repo2docker** is a tool to build, run and push docker images from source code repositories. **jupyter-repo2docker** is a tool to build, run and push docker images from source code repositories.
## Pre-requisites ## Pre-requisites
1. Docker to build & run the repositories. The [community edition](https://store.docker.com/search?type=edition&offering=community) 1. Docker to build & run the repositories. The [community edition](https://store.docker.com/search?type=edition&offering=community)
is recommended. is recommended.
2. Python 3.4+. 2. Python 3.4+.
## Installation ## Installation
To install from pypi, the python packaging index: To install from pypi, the python packaging index:
```bash ```bash
pip install jupyter-repo2docker pip install jupyter-repo2docker
``` ```
To install from source: To install from source:
```bash ```bash
git clone https://github.com/jupyter/repo2docker.git git clone https://github.com/jupyter/repo2docker.git
cd repo2docker cd repo2docker
pip install . pip install .
``` ```
## Usage ## Usage
The core feature of repo2docker is to fetch a repo (from github or locally), build a container The core feature of repo2docker is to fetch a repo (from github or locally), build a container
image based on the specifications found in the repo & optionally launch a local Jupyter Notebook image based on the specifications found in the repo & optionally launch a local Jupyter Notebook
you can use to explore it. you can use to explore it.
**Note that Docker needs to be running on your machine for this to work.** **Note that Docker needs to be running on your machine for this to work.**
Example: Example:
```bash ```bash
jupyter-repo2docker https://github.com/jakevdp/PythonDataScienceHandbook jupyter-repo2docker https://github.com/jakevdp/PythonDataScienceHandbook
``` ```
After building (it might take a while!), it should output in your terminal something like: After building (it might take a while!), it should output in your terminal something like:
``` ```
Copy/paste this URL into your browser when you connect for the first time, Copy/paste this URL into your browser when you connect for the first time,
to login with a token: to login with a token:
http://0.0.0.0:36511/?token=f94f8fabb92e22f5bfab116c382b4707fc2cade56ad1ace0 http://0.0.0.0:36511/?token=f94f8fabb92e22f5bfab116c382b4707fc2cade56ad1ace0
``` ```
If you copy paste that URL into your browser you will see a Jupyter Notebook with the If you copy paste that URL into your browser you will see a Jupyter Notebook with the
contents of the repository you had just built! contents of the repository you had just built!
### Displaying the image Dockerfile ### Displaying the image Dockerfile
Repo2Docker will generate a Dockerfile that composes the created Docker image. Repo2Docker will generate a Dockerfile that composes the created Docker image.
To see the contents of this Dockerfile without building the image use `--debug` and `--no-build` To see the contents of this Dockerfile without building the image use `--debug` and `--no-build`
flags like so: flags like so:
```bash ```bash
jupyter-repo2docker --debug --no-build https://github.com/jakevdp/PythonDataScienceHandbook jupyter-repo2docker --debug --no-build https://github.com/jakevdp/PythonDataScienceHandbook
``` ```
## Repository specifications ## Repository specifications
Repo2Docker looks for various files in the repository being built to figure out how to build it. Repo2Docker looks for various files in the repository being built to figure out how to build it.
It is philosophically similar to [Heroku Build Packs](https://devcenter.heroku.com/articles/buildpacks). It is philosophically similar to [Heroku Build Packs](https://devcenter.heroku.com/articles/buildpacks).
It currently looks for the following files. They are all composable - you can use any number of them It currently looks for the following files. They are all composable - you can use any number of them
in the same repository (except for Dockerfiles, which take precedence over everything else). in the same repository (except for Dockerfiles, which take precedence over everything else).
### `requirements.txt` ### `requirements.txt`
This specifies a list of python packages that would be installed in a virtualenv (or conda environment). This specifies a list of python packages that would be installed in a virtualenv (or conda environment).
### `environment.yml` ### `environment.yml`
This is a conda environment specification, that lets you install packages with conda. Note that you must This is a conda environment specification, that lets you install packages with conda. Note that you must
leave the name of the environment empty for this to work out of the box. leave the name of the environment empty for this to work out of the box.
### `apt.txt` ### `apt.txt`
A list of debian packages that should be installed. The base image used is usually the latest released A list of debian packages that should be installed. The base image used is usually the latest released
version of Ubuntu (currently Zesty.) version of Ubuntu (currently Zesty.)
### `postBuild` ### `postBuild`
A script that can contain arbitrary commands to be run after the whole repository has been built. If you A script that can contain arbitrary commands to be run after the whole repository has been built. If you
want this to be a shell script, make sure the first line is `#!/bin/bash`. This file must have the want this to be a shell script, make sure the first line is `#!/bin/bash`. This file must have the
executable bit set (`chmod +x postBuild`) to be considered. executable bit set (`chmod +x postBuild`) to be considered.
### `REQUIRE` ### `REQUIRE`
This specifies a list of Julia packages! Currently only version 0.6 of Julia is supported, but more will This specifies a list of Julia packages! Currently only version 0.6 of Julia is supported, but more will
be as they are released. be as they are released.
### `Dockerfile` ### `Dockerfile`
This will be treated as a regular Dockerfile and a regular Docker build will be performed. The presence This will be treated as a regular Dockerfile and a regular Docker build will be performed. The presence
of a Dockerfile will cause all other building behavior to not be triggered. of a Dockerfile will cause all other building behavior to not be triggered.

Plik diff jest za duży Load Diff

Wyświetl plik

@ -8,7 +8,12 @@ Jupyter extension.
.. note:: .. note::
This file needs to be executable in order to work with ``repo2docker``. The This file needs to be executable in order to work with ``repo2docker``. If
easiest way to do this is to run the following command with ``git``:: you're on Linux or macOS, run::
chmod +x postBuild
If you're on windows, you can accomplish the same behavior with this
``git`` command::
git update-index --chmod=+x postBuild git update-index --chmod=+x postBuild