티스토리 뷰

https://stackoverflow.com/a/49647309/10386667

 

Interactive shell using Docker Compose

Is there any way to start an interactive shell in a container using Docker Compose only? I've tried something like this, in my docker-compose.yml: myapp: image: alpine:latest entrypoint: /bin/sh

stackoverflow.com

 

docker compose run {서비스 이름} /bin/bash

 

만약 yaml 파일이 아래와 같이 작성돼있다면 {서비스 이름}에 app을 넣어주면 됨

 

stdin_open, tty 를 true로 설정해줘도 docker compose up 했을때 shell 로 안 붙길래 찾다가 기록...

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함