Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

312
Visualizações
How can I attach to docker container running in detached mode?

If I start up a docker container in detached mode using the command:

docker run -d ubuntu

the container immediately exits. docker ps -a yields the output (selected columns shown):

CONTAINER ID        IMAGE               COMMAND             STATUS
245fe871a1e3        ubuntu              "/bin/bash"         Exited (0) 4 minutes ago

Is it possible to start the same container (container ID 245fe871a1e3) in interactive mode with a terminal session?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I'm afraid there's no such a way to archive this. docker attach and docker exec are working against running container only, but if you docker start the container in your case, it'll exited immediately again because the CMD is /bin/bash.

There's also a discussion about this, post some key info here:

It's not possible to enter a stopped container, because the processes are gone, and therefore, the namespaces are gone as well.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda