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

619
Visualizações
How to extend existing docker container?

The tensorflow docker container is available at https://hub.docker.com/r/tensorflow/tensorflow/ to extend this container with additional libraries such as requests I'm aware of two options.

  1. Run the container and run pip install requests
  2. Append pip install requests to the dockerFile that builds this container

Is there an alternative option ? Something like creating the tensorflow/tensorflow container from a dockerFile and then installing requests on this container.

Reading How to extend an existing docker image? to accomplish this create a dockerFile with these contents ? :

FROM tensorflow/tensorflow
RUN pip install requests
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Your original assertion is correct, create a new Dockerfile:

FROM tensorflow/tensorflow
RUN pip install requests

now build it (note that the name should be lower case):

docker build -t me/mytensorflow .

run it:

docker run -it me/mytensorflow

execute a shell in it (docker ps -ql gives us an id of the last container to run):

docker exec -it `docker ps -ql` /bin/bash

get logs from it:

docker logs `docker ps -ql`

The ability to extend other images is what makes docker really powerful, in addition you can go look at their Dockerfile:

https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/docker

and start from there as well without extending their docker image, this is a best practice for people using docker in production so you know everything is built in-house and not by some hacker sneaking stuff into your infrastructure. Cheers! and happy building

over 4 years ago · Santiago Trujillo Relatório

0

you could enter the running container via:

docker exec -it CONTAINER_ID bin/bash

or if a name is set:

docker exec -it CONTAINER_NAME bin/bash
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