質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
docker-compose

docker-composeとは、複数のコンテナで構成されるサービスを提供する手順を自動的し管理を簡単にするツール。composeファイルを使用しコマンド1回で設定した全サービスを作成・起動することが可能です。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

1回答

4292閲覧

docker-compose up --build -dでエラーが出てしまう

yuuuuuuri

総合スコア21

docker-compose

docker-composeとは、複数のコンテナで構成されるサービスを提供する手順を自動的し管理を簡単にするツール。composeファイルを使用しコマンド1回で設定した全サービスを作成・起動することが可能です。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2022/05/18 09:18

編集2022/05/18 14:20

実現したいこと

現在、docker-compose up --build -dでDockerを動かしたいのですが、該当のエラーコードがでてしまいます。
インターネット上にのっている様々な方法を試しましたが、解決しないため、こちらで質問させていただきました。

発生している問題・エラーメッセージ

[+] Building 59.7s (5/11) => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 32B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 34B 0.0s => [internal] load metadata for docker.io/nvidia/cuda:11.0-devel-ubuntu20.04 6.7s => CACHED [1/8] FROM docker.io/nvidia/cuda:11.0-devel-ubuntu20.04@sha256:bd7a97c99c7a2bcc183ea07e6b193727de3d180 0.0s => ERROR [2/8] RUN apt update && apt install --no-install-recommends -y software-properties-common 52.7s ------ > [2/8] RUN apt update && apt install --no-install-recommends -y software-properties-common: #0 0.638 #0 0.638 WARNING: apt does not have a stable CLI interface. Use with caution in scripts. #0 0.638 #0 0.799 Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease [1581 B] #0 1.029 Err:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease #0 1.029 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC #0 1.038 Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] #0 1.209 Get:3 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB] #0 2.032 Get:4 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [27.5 kB] #0 2.328 Get:5 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1174 kB] #0 2.541 Get:6 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] #0 2.974 Get:7 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB] #0 3.459 Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB] #0 5.503 Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1816 kB] #0 10.60 Get:10 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [874 kB] #0 34.97 Get:11 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB] #0 35.45 Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB] #0 39.05 Get:13 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB] #0 39.13 Get:14 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [1252 kB] #0 42.41 Get:15 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [30.2 kB] #0 42.50 Get:16 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1161 kB] #0 45.59 Get:17 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2245 kB] #0 51.79 Get:18 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [51.2 kB] #0 51.94 Get:19 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [26.0 kB] #0 52.02 Reading package lists... #0 52.69 W: GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC #0 52.69 E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease' is not signed. ------ failed to solve: executor failed running [/bin/sh -c apt update && apt install --no-install-recommends -y software-properties-common]: exit code: 100

Dockerfile

ARG BASE_IMAGE=nvidia/cuda:11.0-devel-ubuntu20.04 FROM ${BASE_IMAGE} ARG PROJECT_NAME=ascender ARG USER_NAME=challenger ARG PYTHON_VERSION=3.8 ARG APPLICATION_DIRECTORY=/home/${USER_NAME}/${PROJECT_NAME} ENV DEBIAN_FRONTEND="noninteractive" \ LC_ALL="C.UTF-8" \ LANG="C.UTF-8" \ PYTHONPATH=${APPLICATION_DIRECTORY} # Following is needed to install python 3.7 RUN apt update && apt install --no-install-recommends -y software-properties-common RUN add-apt-repository ppa:deadsnakes/ppa RUN apt update && apt install --no-install-recommends -y \ git curl make ssh openssh-client \ python${PYTHON_VERSION} python3-pip python-is-python3 # Following is needed to swtich default python3 version # For detail, please check following link https://unix.stackexchange.com/questions/410579/change-the-python3-default-version-in-ubuntu RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \ && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \ && pip3 install poetry # Add user. Without this, following process is executed as admin. RUN useradd -ms /bin/sh ${USER_NAME} USER ${USER_NAME} WORKDIR ${APPLICATION_DIRECTORY} # Create virtual environments inside of project. RUN poetry config virtualenvs.in-project true

docker-compose.yml

version: "3.8" services: core: runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all build: args: - BASE_IMAGE=nvidia/cuda:11.0-devel-ubuntu20.04 - PYTHON_VERSION=3.8 context: ../../ dockerfile: environments/Dockerfile user: 1000:1000 tty: true volumes: - ../../:/home/challenger/ascender ports: - 8000:8000

Dockerにあまり触れたことがなかったこともあり、お恥ずかしい質問で申し訳ないのですが、ご回答いただけますと幸いです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yamap55

2022/05/18 12:52

1. エラーをキャプチャではなく文字列で記載してください。 2. Dockerfileとdocker-compose.ymlを記載してください。 ※質問は編集できます。
guest

回答1

0

ベストアンサー

エラーの原因はコイツですね。

#0 52.69 E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease' is not signed.

NVIDIAの公式サイトを確認したところ、
4月28日に、NVIDIAの署名キー(Signing Keys)が更新されたとのことです。

https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/

解決策は、上記の公式サイトに書いてありますが、
Dockerfileに以下のコマンドを追加すればいけるかと思います。

RUN apt-key del 7fa2af80 RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb RUN dpkg -i cuda-keyring_1.0-1_all.deb RUN apt update && apt install --no-install-recommends -y software-properties-common

RUNステートメントは「&」で連結してもOKです。
※ちなみに、「&」で連結することで、RUNコマンドごとに新しいDockerイメージを作成し、不要なイメージ作成を回避することができます

投稿2022/05/19 00:39

AdachiRyohei

総合スコア11

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yuuuuuuri

2022/05/19 11:04

回答いただきありがとうございます。 Dockerfileに記述いただいたコマンドを追加したのですが、同じエラーが出てしまいます。。。
AdachiRyohei

2022/05/19 13:16

失礼しました・・ 下記の内容をDockerfileに記述してお試しください。 (Python3.7をインストールする直前です。) 私も端末上で動作検証を行い、無事にDockerビルド成功しました。 ----------------------------------------------- ⇓下記の内容を追加 RUN rm -f /etc/apt/sources.list.d/cuda.list \ && apt-get update && apt-get install -y --no-install-recommends \ wget \ && wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb \ && dpkg -i cuda-keyring_1.0-1_all.deb \ && rm -f cuda-keyring_1.0-1_all.deb ↑ここまで追加 # Following is needed to install python 3.7 RUN apt-get update && apt install --no-install-recommends -y software-properties-common RUN add-apt-repository ppa:deadsnakes/ppa
yuuuuuuri

2022/05/20 15:07

無事解決しました! ご教授いただき本当にありがとうございました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問