9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker buildのRUNのログも保存

Last updated at Posted at 2014-10-16
  • /root/build.logにログが保存される。
Dockerfile
FROM centos:centos7

RUN \
  exec >& /root/build.log ;\
  set -eux ;\
  yum -y install epel-release ;\
  yum -y update ;\
  yum -y install PyYAML python-jinja2 python-httplib2 python-keyczar python-paramiko python-setuptools git python-pip ;\
  yum clean all ;\
  mkdir /etc/ansible/ ;\
  echo '[local]\nlocalhost\n' > /etc/ansible/hosts ;\
  mkdir /opt/ansible/ ;\
  git clone http://github.com/ansible/ansible.git /opt/ansible/ansible

WORKDIR /opt/ansible/ansible

ENV PATH /opt/ansible/ansible/bin:/bin:/usr/bin:/sbin:/usr/sbin
ENV PYTHONPATH /opt/ansible/ansible/lib
ENV ANSIBLE_LIBRARY /opt/ansible/ansible/library
docker build .

Build Error時の対応

  • 長いRUNを1つづつのRUNに分割する。
  • 手元でbuildする場合は、--no-cacheオプションをつける。
    • docker build --no-cache .
  • &でバックグラウンドにしたい場合、\&と書く。
9
8
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
9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?