使用docker设置django,docker文件如下所示
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
RUN apt-get update
RUN apt-get install software-properties-common --yes
RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable
RUN apt-get update
RUN apt-get install postgis
WORKDIR /code
COPY . /code/
RUN pip install -r requirements.txt
除其他事项外,它还使用ppa ubuntugis设置了postgis
但是在设置时会引发此错误
Step 5/11 : RUN apt-get install software-properties-common --yes
---> Using cache
---> 634a13159403
Step 6/11 : RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable
---> Using cache
---> 983fbcf8fd46
Step 7/11 : RUN apt-get update
---> Running in aaf66c98507c
Ign:1 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco InRelease
Hit:2 http://security.debian.org/debian-security stretch/updates InRelease
Ign:3 http://deb.debian.org/debian stretch InRelease
Ign:4 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco Release
Hit:5 http://deb.debian.org/debian stretch-updates InRelease
Hit:6 http://deb.debian.org/debian stretch Release
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Err:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
404 Not Found
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Reading package lists...
W: The repository 'http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco Release' does not have a Release file.
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu/dists/disco/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update' returned a non-zero code: 100
即使在不使用docker的情况下原本打算安装仓库,也无法找到该仓库。
这是在本地使用的django项目,现在使其通过docker工作是新的挑战。