1
0

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 1 year has passed since last update.

docker コンテナ内の例えば .bash_profile の設定を反映して実行したい

Posted at

Login を伴うのであれば、--login オプションを付ければ、反映される。

docker run -it something_image bash --login

以下のように、Login せずにコマンドだけ実行させたい場合があった。

docker run something_image ls -l

強引ではあるが、以下のように対処した。

docker run something_image bash -c "source /home/root/.bash_profile && ls -l"
1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?