-
rootユーザに移行
-
docker-composeのインストール
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
-
実行権限を付与
sudo chmod +x /usr/local/bin/docker-compose
-
docker-compose.ymlファイルを作成
vim docker-compose.yml
以下は、
docker-compose.yml
の例docker-compose.ymlservices: ansible-container: image: ansible-container-image container_name: ansible-container network_mode: host # ホストのネットワークを使う tty: true # コンテナ内でインタラクティブに作業できるようにする build: ./Dockerfile command: sleep infinity
-
MakeFileの作成
vim Makefile
内容は以下
# Rocky Linux 9のベースイメージを取得 pull-image: docker pull rockylinux:9 # docker-compose.ymlを実行 up: pull-image docker-compose up
-
makeを実行
make up
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme