LoginSignup
0
0

More than 3 years have passed since last update.

docker run --tmpfsでエラーが出た時の対処方法

Last updated at Posted at 2020-07-04

はじめに

本記事は以下の「Docker実践ガイド 第2版」を進めていて詰まったポイントの解決メモです。

91j47MxChxL.jpg

3-9-1 コンテナでのApache Webサービスの起動

/sbin/initを使ったDockerコンテナの起動

ここで示されているコマンド

$ docker container run \ 
-it \
--tmpfs /tmp \
--tmpfs /run \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
--stop-signal SIGRTMIN+3 \
--name test01 \
-h test01 \
centos:test01 /sbin/init

を実行したところ、

docker: invalid reference format.
See 'docker run --help'.

と返された。
docker run --help
を実行したところ、きちんと全てのオプションは見つかって使い方も問題なさそう。

いろいろ調べた結果
--tmpfs /tmp
となっている--tmpfsオプションを
--mount type=tmpfs,destination=/tmp
のように--mountオプションで代替することで解決

修正後

$ docker run \
-it \
--mount type=tmpfs,destination=/tmp \
--mount type=tmpfs,destination=/run \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
--stop-signal SIGRTMIN+3 \
--name test01 \
-h test01 \
centos:test01 /sbin/init

参考

Docker Documentation

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