Docker - apt-get安装失败

时间:2018-02-11 17:22:34

标签: docker docker-compose dockerfile

我有一个非常简单的docker-compose / docker-sync脚本:

搬运工-撰写-dev.yml

# this is our development docker-compose building on top of the production docker-compose, just mounting
# the sync image - not redefining anything else

version: "2"
services:
  apache:
    volumes:
      - ./docker-config/vhost:/etc/apache2/sites-enabled/000-default.conf
      - jettsw53-sync:/var/www/html:nocopy # nocopy is important

# that the important thing
volumes:
  jettsw53-sync:
    external: true

搬运工-compose.yml

version: '2'
services:
  apache:
    build: .
    ports:
      - 80:80

  db:
    image: orchardup/mysql
    ports:
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: jettsw53

Dockerfile

FROM bylexus/apache-php7

RUN apt-get update && \
    apt-get install -y \
      curl \
      vim

CMD ["/usr/local/bin/run"]

搬运工-sync.yml

version: "2"

options:
  verbose: true
syncs:
  jettsw53-sync: # tip: add -sync and you keep consistent names as a convention
    src: './src'
    sync_excludes: ['.git', 'var/cache/*']

当我开始此设置时,运行apt-get install时出现此错误:

Building apache
Step 1/3 : FROM bylexus/apache-php7
 ---> 97d3e723b95a
Step 2/3 : RUN apt-get update &&     apt-get install -y       curl       vim
 ---> Running in ae4aa07c3b4f
Ign:1 http://security.ubuntu.com/ubuntu yakkety-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu yakkety InRelease
Err:3 http://security.ubuntu.com/ubuntu yakkety-security Release
  404  Not Found [IP: 91.189.88.161 80]
Ign:4 http://archive.ubuntu.com/ubuntu yakkety-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu yakkety-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu yakkety Release
  404  Not Found [IP: 91.189.88.152 80]
Err:7 http://archive.ubuntu.com/ubuntu yakkety-updates Release
  404  Not Found [IP: 91.189.88.152 80]
Err:8 http://archive.ubuntu.com/ubuntu yakkety-backports Release
  404  Not Found [IP: 91.189.88.152 80]
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu yakkety-security Release' does no longer have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu yakkety Release' does no longer have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu yakkety-updates Release' does no longer have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu yakkety-backports Release' does no longer have a Release file.
Service 'apache' failed to build: The command '/bin/sh -c apt-get update &&     apt-get install -y       curl       vim' returned a non-zero code: 100
EXCEPTION: #<Docker::Compose::Error: 'up' failed with status 'pid 40288 exit 1': Step 1/3 : FROM bylexus/apache-php7>
MESSAGE: 'up' failed with status 'pid 40288 exit 1': Step 1/3 : FROM bylexus/apache-php7

有人知道这里发生了什么,我该如何解决?

1 个答案:

答案 0 :(得分:1)

您指向的是不受支持/不再受支持的Ubuntu版本。使用

  • 16.04 LTS版本,或
  • 17.10当前版本
已经关闭了16.10和17.04(在后者的情况下有些恼人)。 FWIW我倾向于在少数几台机器上每六个月升级一次,这通常只是游泳。