LoginSignup
2
2

More than 5 years have passed since last update.

Debian7のDockerfileのひな形

Posted at

いちいちコピってくるのも面倒なのでここに貼っておく。

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