Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Docker in interactive mode using an official Microsoft .Net Core SDK image

I'm trying to enter interactive mode using an official Microsoft .Net Core image and use typical .Net commands such as 'dotnet build', but all I get is an '>' cursor. What am I doing wrong?

I'm using the following command:

docker run -it -v $(pwd):/app' -w '/app' -p 8000:80 mcr.microsoft.com/dotnet/core/sdk /bin/bash

I was hoping to get a root command prompt, but all I'm getting is '>'

like image 921
John Morsley Avatar asked May 27 '26 14:05

John Morsley


1 Answers

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

After running your container, run command docker ps to take [Container ID]

And after you are able to run the command like there docker exec -it [Container ID] bash .

like image 109
Igor Cova Avatar answered May 30 '26 04:05

Igor Cova