10
10

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.

データコンテナの使い方

Last updated at Posted at 2014-11-02

他のコンテナと共有できるようにVOLUME設定

Dockerfile
FROM busybox
VOLUME /var/log/rsyslog
ENTRYPOINT tail -f /dev/null
docker build -t private/data:rsyslog .

他のコンテナから利用してみる

docker run -d --name data_rsyslog private/data:rsyslog

docker run --privileged -it -d \
  --name rsyslog \
  --volumes-from data_rsyslog \
  -p 514:514/udp -p 514:514/tcp -p 8080:80 \
  tukiyo3/centos7-rsyslog
データが書き込まれていることを確認
docker exec -it data_rsyslog find /var/log/rsyslog/ -type f

データコンテナに入る方法

データが書き込まれていることを確認
docker exec -it data_rsyslog sh
10
10
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
10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?