Skip to content

Commit

Permalink
Don't print appendix on each run for legacy dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed May 29, 2017
1 parent e81703a commit a10c126
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions repo2docker/detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def build(self, workdir, ref, output_image_spec):


class LegacyBinderDockerBuildPack(DockerBuildPack):

name = Unicode('Legacy Binder Dockerfile')

dockerfile_appendix = Unicode(dedent(r"""
USER root
COPY . /home/main/notebooks
Expand All @@ -71,7 +72,7 @@ class LegacyBinderDockerBuildPack(DockerBuildPack):
ENV JUPYTER_PATH /home/main/anaconda2/share/jupyter:$JUPYTER_PATH
CMD jupyter notebook --ip 0.0.0.0
"""), config=True)

def detect(self, workdir):
dockerfile = os.path.join(workdir, 'Dockerfile')
if not os.path.exists(dockerfile):
Expand All @@ -88,7 +89,6 @@ def detect(self, workdir):
return False

def amend_dockerfile(self, dockerfile):
print(self.dockerfile_appendix)
with open(dockerfile, 'a') as f:
f.write(self.dockerfile_appendix)

Expand Down

0 comments on commit a10c126

Please sign in to comment.