Skip to content

Instantly share code, notes, and snippets.

@nntsugu
Last active July 11, 2019 06:04
Show Gist options
  • Save nntsugu/eabdae94d057f8016ee1a702c8d88732 to your computer and use it in GitHub Desktop.
Save nntsugu/eabdae94d057f8016ee1a702c8d88732 to your computer and use it in GitHub Desktop.
Docker runで起動したコンテナにすぐログインしたい(docker psとかコピペがめんどくさい) ref: https://qiita.com/nntsugu/items/1fed4ff37afd845d6a7f
bash
cd ${PATH to Dockerfile};pwd
export DREP=<<REPOSITORY_NAME>>
export DTAG=<<TAG>>
docker build . -t ${DREP}:${DTAG}
docker run -itd ${DREP}:${DTAG}
docker exec -it $(docker ps -lq) bash
docker stop $(docker ps -lq) &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment