E: "nginx" の "1.14.0-0ubuntu1.9" バージョンが見つかりません。

E:
FROM ubuntu:bionic

ENV NGINX_VERSION 1.14.0-0ubuntu1.9

RUN apt-get update && apt-get install -y curl
RUN apt-get update && apt-get install -y nginx=$NGINX_VERSION

CMD ["nginx", "-g", "daemon off;"]

カスタムnginx dockerイメージを作成しようとしてエラーが発生します。

E: Version '1.14.0-0ubuntu1.9' for 'nginx' was not found
The command '/bin/sh -c apt-get update && apt-get install -y nginx=$NGINX_VERSION' returned a non-zero code: 100

ベストアンサー1

aptあなたの場合、リポジトリには通常、特定のバージョン用の単一バージョンのパッケージしかありません。リポジトリは現在、このパッケージbionicのバージョン1.14.0-0ubuntu1.11を提供しています。nginx

実際、これはコンテナファイルを次のように作成する必要があることを意味します。

FROM ubuntu:bionic

RUN apt-get update && apt-get install -y curl
RUN apt-get update && apt-get install -y nginx

CMD ["nginx", "-g", "daemon off;"]

apt-get実際には、2行をマージしてレイヤーを保存できます。

RUN apt-get update && apt-get install -y curl nginx

バラより以前のバージョンの Debian パッケージがパッケージリポジトリから消えるのはなぜですか? (バージョン管理システム構成との関連性が高い)詳細はこちらUbuntuリポジトリの動作は同じです。

おすすめ記事