Update the source links used by the legacy buildpack

Debian Jessie is now "archived" so we need to update the links to the
sources.
pull/633/head
Tim Head 2019-03-29 09:40:10 +01:00
rodzic 053a623f13
commit 03bea07334
2 zmienionych plików z 19 dodań i 3 usunięć

Wyświetl plik

@ -11,13 +11,19 @@ import shutil
from textwrap import dedent from textwrap import dedent
from ..docker import DockerBuildPack from ..docker import DockerBuildPack
class LegacyBinderDockerBuildPack(DockerBuildPack): class LegacyBinderDockerBuildPack(DockerBuildPack):
"""Legacy build pack for compatibility to first version of Binder.""" """Legacy build pack for compatibility to first version of Binder."""
dockerfile = '._binder.Dockerfile' dockerfile = '._binder.Dockerfile'
legacy_prependix = dedent(r""" legacy_prependix = dedent(r"""
USER root
# update the source list now that jessie is archived
COPY apt-sources.list /etc/apt/sources.list
USER main
COPY python3.frozen.yml /tmp/python3.frozen.yml COPY python3.frozen.yml /tmp/python3.frozen.yml
COPY root.frozen.yml /tmp/root.frozen.yml COPY root.frozen.yml /tmp/root.frozen.yml
# update conda in two steps because the base image # update conda in two steps because the base image
# has very old conda that can't upgrade past 4.3 # has very old conda that can't upgrade past 4.3
RUN conda install -yq conda>=4.3 && \ RUN conda install -yq conda>=4.3 && \
@ -35,7 +41,8 @@ class LegacyBinderDockerBuildPack(DockerBuildPack):
COPY . /home/main/notebooks COPY . /home/main/notebooks
RUN chown -R main:main /home/main/notebooks && \ RUN chown -R main:main /home/main/notebooks && \
rm /home/main/notebooks/root.frozen.yml && \ rm /home/main/notebooks/root.frozen.yml && \
rm /home/main/notebooks/python3.frozen.yml rm /home/main/notebooks/python3.frozen.yml && \
rm /home/main/notebooks/apt-sources.list
USER main USER main
WORKDIR /home/main/notebooks WORKDIR /home/main/notebooks
ENV PATH /home/main/anaconda2/envs/python3/bin:$PATH ENV PATH /home/main/anaconda2/envs/python3/bin:$PATH
@ -81,9 +88,11 @@ class LegacyBinderDockerBuildPack(DockerBuildPack):
return { return {
'legacy/root.frozen.yml': '/tmp/root.frozen.yml', 'legacy/root.frozen.yml': '/tmp/root.frozen.yml',
'legacy/python3.frozen.yml': '/tmp/python3.frozen.yml', 'legacy/python3.frozen.yml': '/tmp/python3.frozen.yml',
'legacy/apt-sources.list': '/tmp/apt-sources.list',
} }
def build(self, client, image_spec, memory_limit, build_args, cache_from, extra_build_kwargs): def build(self, client, image_spec, memory_limit, build_args, cache_from,
extra_build_kwargs):
"""Build a legacy Docker image.""" """Build a legacy Docker image."""
with open(self.dockerfile, 'w') as f: with open(self.dockerfile, 'w') as f:
f.write(self.render()) f.write(self.render())
@ -94,7 +103,12 @@ class LegacyBinderDockerBuildPack(DockerBuildPack):
env_file, env_file,
) )
shutil.copy(src_path, env_file) shutil.copy(src_path, env_file)
return super().build(client, image_spec, memory_limit, build_args, cache_from, extra_build_kwargs)
src_path = os.path.join(os.path.dirname(__file__), 'apt-sources.list')
shutil.copy(src_path, 'apt-sources.list')
return super().build(client, image_spec, memory_limit, build_args,
cache_from, extra_build_kwargs)
def detect(self): def detect(self):
"""Check if current repo should be built with the Legacy BuildPack. """Check if current repo should be built with the Legacy BuildPack.

Wyświetl plik

@ -0,0 +1,2 @@
deb http://archive.debian.org/debian jessie main
deb http://security.debian.org jessie/updates main