1
0

More than 3 years have passed since last update.

docker分からないメンバーにも簡単にdocker環境を使ってもらう方法

Last updated at Posted at 2021-01-30

はじめに

経験の浅い新人や、dockerに不慣れな人にも簡単にdocker環境を作る

dockerコマンドを記載したbatファイルを準備

docker up

boot.bat
@echo off
docker-compose up -d
pause

docker down

down.bat
@echo off
docker-compose down
pause

docker restart

restart.bat
@echo off
docker-compose restart
pause

docker refresh
(キャッシュクリア)

refresh.bat
@echo off
docker-compose exec 【コンテナ名】 /bin/bash -c "cd /var/www/html/【プロジェクトディレクトリ】 && 【キャッシュクリアコマンド】"
pause

laravelのキャッシュクリアをする場合

refresh.bat
@echo off
docker-compose exec 【コンテナ名】/bin/bash -c "cd /var/www/html/【開発ディレクトリ】 && php artisan config:cache"
pause

まとめ

開発中に使用するコマンドが限られているので、
必要なコマンドのみbat化すると便利です。

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