1

gpu kaggleのdockerを使って環境構築をしております。
Dockerfile内でapt-get -y updateを実行したいのですが、通りません。
ご教授いただければ幸いです。

実行環境 ubuntu 20.04

error code

$docker-compose up -d
Building app
Step 1/9 : FROM gcr.io/kaggle-gpu-images/python
 ---> 438d71ac4959
Step 2/9 : USER root
 ---> Using cache
 ---> a6dbd7295f36
Step 3/9 : RUN apt-get -y update
 ---> Running in ba8afb887da7
Get:1 http://packages.cloud.google.com/apt gcsfuse-bionic InRelease [5385 B]
Ign:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease
Ign:3 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64  InRelease
Get:4 http://packages.cloud.google.com/apt cloud-sdk-bionic InRelease [6786 B]
Get:5 http://packages.cloud.google.com/apt cloud-sdk InRelease [6739 B]
Err:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  Release
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 152.199.39.144 443]
Err:7 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64  Release
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 152.199.39.144 443]
Ign:8 http://packages.cloud.google.com/apt cloud-sdk-bionic/main amd64 Packages
Get:9 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:8 http://packages.cloud.google.com/apt cloud-sdk-bionic/main amd64 Packages [205 kB]
Get:10 http://packages.cloud.google.com/apt cloud-sdk/main amd64 Packages [185 kB]
Hit:11 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:13 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2324 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2760 kB]
Get:16 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1428 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [567 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [600 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2202 kB]
Reading package lists...
W: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/InRelease: No system certificates available. Try installing ca-certificates.
W: https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/InRelease: No system certificates available. Try installing ca-certificates.
W: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  Release' no longer has a Release file.
W: https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64  Release' no longer has a Release file.
ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get -y update' returned a non-zero code: 100

Dockerfile

FROM gcr.io/kaggle-gpu-images/python

USER root
RUN apt-get -y update
RUN apt-get install -y openssh-server && \
    apt-get clean

ENV lang="ja_jp.utf-8" language="ja_jp:ja" lc_all="ja_jp.utf-8"

RUN mkdir /root/.ssh /workdir /run/sshd && \
    chmod 700 /root/.ssh && \
    sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config && \
    sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config

ADD authorized_keys /root/.ssh/authorized_keys
RUN chmod 700 /opt/run.sh && chmod 600 /root/.ssh/authorized_keys

ADD run.sh /opt/run.sh
ADD . /tmp/working
WORKDIR /tmp/working
CMD /opt/run.sh

docker-compose.yml

version: '2.3'

services:
  app:
    runtime: nvidia
    build: .
    shm_size: '2gb'
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=all
    volumes:
      - ./:/tmp/working
    working_dir: /tmp/working
    ports: 
      - "8888:8888"
    tty: true

run.sh

#/bin/bash

/usr/sbin/sshd
jupyter notebook --ip=0.0.0.0 --allow-root --no-browser --NotebookApp.token="pasword" --notebook-dir=/tmp/working

2021/09/15追記
おそらくこのエラーだと考えられます。
https://github.com/NVIDIA/nvidia-docker/issues/1296#issuecomment-646521766
プロキシ環境下で行っているので、上記エラーが発生しているのではないかと考えております。
docker内で
$curl -k -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo -E apt-key add -
を実行すると以下のエラーがでて実行できませんでした。

$curl -k -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo -E apt-key add -
bash: sudo: command not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3195  100  3195    0     0  10175      0 --:--:-- --:--:-- --:--:-- 10175
(23) Failed writing body
1
  • sudo: command not found と表示されていますので、まずはsudo パッケージをインストールする必要があります。
    – metropolis
    Commented 2021年9月15日 2:14

0

この質問に回答するには、ログインする必要があります。

のタグが付いた他の質問を参照する。