docker でよく使うコマンドのメモ
よく使うコマンド
docker-compose down
docker-compose build --no-cache
docker-compose up -d
docker-compose ps
docker-compose logs -f
docker-compose exec <container_name> /bin/bash
docker exec -it <container_name> /bin/bash
使い捨てコンテナで実験
docker run -it --rm --name tmp alpine /bin/sh
my-alpine を作成
docker build -t my-alpine:3.12 -<< 'EOF'
FROM alpine:3.12
RUN set -x && \
apk add --no-cache bash bash-completion git vim vimdiff iproute2 && \
mkdir -p ~/git && \
cd ~/git/ && \
git clone https://github.com/teityura/dotfiles.git && \
cd dotfiles/ && \
./copy-dotfiles.sh
CMD ["/bin/bash"]
EOF
コメント