最終更新:2021-03-01 (月) 17:30:40 (1145d)  

docker exec
Top / docker exec

Run a command in a running container

docker exec <コンテナ名> <コマンド>

  • -iKeep STDIN open even if not attached
    -tAllocate a pseudo-TTY

コンテナに入る

help

  • Usage:  docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
    
    Run a command in a running container
    
    Options:
      -d, --detach               Detached mode: run command in the background
          --detach-keys string   Override the key sequence for detaching a
                                 container
      -e, --env list             Set environment variables
      -i, --interactive          Keep STDIN open even if not attached
          --privileged           Give extended privileges to the command
      -t, --tty                  Allocate a pseudo-TTY
      -u, --user string          Username or UID (format:
                                 <name|uid>[:<group|gid>])
      -w, --workdir string       Working directory inside the container
    

関連