いちいちコピってくるのも面倒なのでここに貼っておく。
FROM debian:wheezy
# aptで日本のミラーを使う
RUN echo "deb http://ftp.jp.debian.org/debian wheezy main non-free contrib" > /etc/apt/sources.list && \
echo "deb-src http://ftp.jp.debian.org/debian wheezy main non-free contrib" && \
echo "deb http://security.debian.org/ wheezy/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://security.debian.org/ wheezy/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://ftp.jp.debian.org/debian wheezy-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://ftp.jp.debian.org/debian wheezy-updates main contrib non-free" >> /etc/apt/sources.list
# インストールに入力待ブロックをしなくなる
ENV DEBIAN_FRONTEND noninteractive
RUN echo "Asia/Tokyo" > /etc/timezone && \
dpkg-reconfigure tzdata
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y sudo && \
apt-get clean
これを使ってビルドしたい場合は以下の様な感じにする。
docker build -t tag_tmp --no-cache .
docker run \
--name tmp_name \
-v "/tmp/tmp:/usr/local/tmp" \
tag_tmp \
sh -c ""
docker rm tmp_name