質問編集履歴

1

エラーを文字列で記載する、Dockerfile、docker-compose.ymlを記載するの2点を変更いたしました。

2022/05/18 14:20

投稿

waaaaaaaa
waaaaaaaa

スコア21

test CHANGED
File without changes
test CHANGED
@@ -3,6 +3,107 @@
3
3
  インターネット上にのっている様々な方法を試しましたが、解決しないため、こちらで質問させていただきました。
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
6
- ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-05-18/65a9bbbc-63e9-4422-953b-47cc2a985eeb.png)
6
+ ```
7
+ [+] Building 59.7s (5/11)
8
+ => [internal] load build definition from Dockerfile 0.0s
9
+ => => transferring dockerfile: 32B 0.0s
10
+ => [internal] load .dockerignore 0.0s
11
+ => => transferring context: 34B 0.0s
12
+ => [internal] load metadata for docker.io/nvidia/cuda:11.0-devel-ubuntu20.04 6.7s
13
+ => CACHED [1/8] FROM docker.io/nvidia/cuda:11.0-devel-ubuntu20.04@sha256:bd7a97c99c7a2bcc183ea07e6b193727de3d180 0.0s
14
+ => ERROR [2/8] RUN apt update && apt install --no-install-recommends -y software-properties-common 52.7s
15
+ ------
16
+ > [2/8] RUN apt update && apt install --no-install-recommends -y software-properties-common:
17
+ #0 0.638
18
+ #0 0.638 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
19
+ #0 0.638
20
+ #0 0.799 Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease [1581 B]
21
+ #0 1.029 Err:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease
22
+ #0 1.029 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
23
+ #0 1.038 Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
24
+ #0 1.209 Get:3 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
25
+ #0 2.032 Get:4 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [27.5 kB]
26
+ #0 2.328 Get:5 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1174 kB]
27
+ #0 2.541 Get:6 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
28
+ #0 2.974 Get:7 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
29
+ #0 3.459 Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
30
+ #0 5.503 Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1816 kB]
31
+ #0 10.60 Get:10 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [874 kB]
32
+ #0 34.97 Get:11 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
33
+ #0 35.45 Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
34
+ #0 39.05 Get:13 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
35
+ #0 39.13 Get:14 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [1252 kB]
36
+ #0 42.41 Get:15 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [30.2 kB]
37
+ #0 42.50 Get:16 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1161 kB]
38
+ #0 45.59 Get:17 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2245 kB]
39
+ #0 51.79 Get:18 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [51.2 kB]
40
+ #0 51.94 Get:19 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [26.0 kB]
41
+ #0 52.02 Reading package lists...
42
+ #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
43
+ #0 52.69 E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease' is not signed.
44
+ ------
45
+ failed to solve: executor failed running [/bin/sh -c apt update && apt install --no-install-recommends -y software-properties-common]: exit code: 100
46
+ ```
47
+
48
+ ### Dockerfile
49
+ ```
50
+ ARG BASE_IMAGE=nvidia/cuda:11.0-devel-ubuntu20.04
51
+ FROM ${BASE_IMAGE}
52
+
53
+ ARG PROJECT_NAME=ascender
54
+ ARG USER_NAME=challenger
55
+ ARG PYTHON_VERSION=3.8
56
+ ARG APPLICATION_DIRECTORY=/home/${USER_NAME}/${PROJECT_NAME}
57
+
58
+ ENV DEBIAN_FRONTEND="noninteractive" \
59
+ LC_ALL="C.UTF-8" \
60
+ LANG="C.UTF-8" \
61
+ PYTHONPATH=${APPLICATION_DIRECTORY}
62
+
63
+ # Following is needed to install python 3.7
64
+ RUN apt update && apt install --no-install-recommends -y software-properties-common
65
+ RUN add-apt-repository ppa:deadsnakes/ppa
66
+
67
+ RUN apt update && apt install --no-install-recommends -y \
68
+ git curl make ssh openssh-client \
69
+ python${PYTHON_VERSION} python3-pip python-is-python3
70
+
71
+ # Following is needed to swtich default python3 version
72
+ # For detail, please check following link https://unix.stackexchange.com/questions/410579/change-the-python3-default-version-in-ubuntu
73
+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
74
+ && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \
75
+ && pip3 install poetry
76
+
77
+ # Add user. Without this, following process is executed as admin.
78
+ RUN useradd -ms /bin/sh ${USER_NAME}
79
+ USER ${USER_NAME}
80
+
81
+ WORKDIR ${APPLICATION_DIRECTORY}
82
+ # Create virtual environments inside of project.
83
+ RUN poetry config virtualenvs.in-project true
84
+ ```
85
+
86
+ ### docker-compose.yml
87
+ ```
88
+ version: "3.8"
89
+
90
+ services:
91
+ core:
92
+ runtime: nvidia
93
+ environment:
94
+ - NVIDIA_VISIBLE_DEVICES=all
95
+ build:
96
+ args:
97
+ - BASE_IMAGE=nvidia/cuda:11.0-devel-ubuntu20.04
98
+ - PYTHON_VERSION=3.8
99
+ context: ../../
100
+ dockerfile: environments/Dockerfile
101
+ user: 1000:1000
102
+ tty: true
103
+ volumes:
104
+ - ../../:/home/challenger/ascender
105
+ ports:
106
+ - 8000:8000
107
+ ```
7
108
 
8
109
  Dockerにあまり触れたことがなかったこともあり、お恥ずかしい質問で申し訳ないのですが、ご回答いただけますと幸いです。