Fix dockerfile builds and add tests for them
MODIFY
.travis.yml
.travis.yml
@@ -18,3 +18,4 @@ env:
- REPO_TYPE=conda
- REPO_TYPE=venv
- REPO_TYPE=julia
+ - REPO_TYPE=dockerfile

MODIFY
repo2docker/detectors.py
repo2docker/detectors.py
@@ -677,6 +677,15 @@ class DockerBuildPack(BuildPack):
with open('Dockerfile') as f:
return f.read()
+ def build(self, image_spec):
+ client = docker.APIClient(version='auto', **docker.utils.kwargs_from_env())
+ for line in client.build(
+ path=os.getcwd(),
+ tag=image_spec,
+ decode=True
+ ):
+ yield line
+
class LegacyBinderDockerBuildPack(BuildPack):
name = 'Legacy Binder Dockerfile'

ADD
tests/dockerfile/jupyter-stack/Dockerfile
+FROM jupyter/base-notebook:b4dd11e16ae4
+
+RUN pip install there
+ADD verify verify

ADD
tests/dockerfile/jupyter-stack/verify
+#!/usr/bin/env python
+import sys
+
+assert sys.version_info[:2] == (3, 6)
+
+import jupyter
+import there

ADD
tests/dockerfile/simple/Dockerfile
+FROM alpine:3.5
+
+ENTRYPOINT "/bin/sh"
+
+ADD sayhi.sh /usr/local/bin/sayhi.sh
+ADD verify verify

ADD
tests/dockerfile/simple/sayhi.sh
+#!/bin/bash
+echo hi
+exit 0

ADD
tests/dockerfile/simple/verify
+#!/bin/sh
+set -e
+/usr/local/bin/sayhi.sh

Fix dockerfile builds and add tests for them