0
0

More than 3 years have passed since last update.

DockerでUbuntuをベースにnodejsをインストールするときに困った話

Posted at

はじめに

DockerでUbuntuのミニマム環境を作っているときに、Node.jsのインストールに戸惑ったのでメモ書きとして残します。

何で困るか

apt-getを使ってインストールするとき、タイムゾーンがわからないので設定しろインタラクティブに聞いてきます。Dockerでコンテナを作るときはインタラクティブにされても困るのでどうしようってなります。

解決策

tzdataというのをインストールすればタイムゾーンがわからないということが起きません!
よってtzdateをインストールしましょう。

具体的には次のようにDockerfileを編集すればよさそうです。

Dockerfile
FROM ubuntu

RUN apt-get update && \
    apt-get install tzdate -y
RUN apt-get install -y nodejs

おわりに

改善があれば追記します。

0
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
0
0