LoginSignup
1
0

More than 1 year has passed since last update.

DockerでNode.jsのインストールに失敗する

Posted at

Dockerでdocker compose up --buildした際に
node-jsをインストールするとこでエラーが出たので、再発用に残しておきます。

エラー箇所

Dockerfile内

RUN apt-get install -y gnupg \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs

エラー内容

Error executing command, exiting

対処法

STEP1 エラー箇所をコメントアウト

# RUN apt-get install -y gnupg \
# && curl -sL https://deb.nodesource.com/setup_10.x | bash - \
# && apt-get install -y nodejs

STEP2 docker compose up --buildを再度実行

STEP3 dockerコンテナに入る

docker exec -ti コンテナ名 bash

STEP4 ソースの削除

rm -rf /var/lib/apt/lists/*
rm -rf /etc/apt/sources.list.d/*
apt-get update

参考:https://askubuntu.com/questions/1141035/error-executing-command-exiting
(sudoがあると怒られたので、sudoなしで実行)

STEP5 コメントアウトしたコマンドを実行

RUN apt-get install -y gnupg
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs

完了

理由については、まだよくわかってませんが、とりあえず動くようにはなりました!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0