Skip to content

Instantly share code, notes, and snippets.

@nekonenene
Last active October 25, 2016 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nekonenene/5a517137ec8df7a2d8a1bc924d90974c to your computer and use it in GitHub Desktop.
Save nekonenene/5a517137ec8df7a2d8a1bc924d90974c to your computer and use it in GitHub Desktop.
最新の node, npm を入れる
FROM ubuntu:trusty
LABEL Description="latest npm" Vendor="nekonenene" Version="1.0"
## 文字コード設定
RUN locale-gen ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV NODE_VERSION 6.4.0
## 基本的なパッケージのインストール
RUN apt-get update && \
apt-get install -y \
curl \
nodejs \
npm
## nodejs, npm を最新に
# n で nodejs のバージョン管理
RUN npm cache clean && \
npm install -g n && \
n $NODE_VERSION
# 最新の npm を取得
RUN curl -L https://npmjs.org/install.sh | sh
# apt で入れた nodejs を削除
RUN apt-get purge -y nodejs npm
## 不要なパッケージを削除
RUN apt-get autoremove -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment