0

I have a program that simply pull a docker image through docker API and run it as a container, I can run it smoothly but my question is, can I dockerize this program?

A few issues I come to is:

  • how do I attach the unix socket /var/run/docker.sock inside the first container?
  • how do I connect it to the internet so it can pull the image?
  • how do I bind the port of the running container inside container to the host port?

Lastly, is it a good idea at all to have a structure like this? if not then what's the alternative?

rixpl
  • 31
  • 7
  • 1
    Welcome to SO, please limit your question to 1. It's actually one of the close vote reasons. Additionally, you may want to showcase a concrete problem, preferably with a minimal reproducible example. – The Fool Apr 05 '22 at 14:06
  • There are answers to all of these questions (a) in the Docker documentation and (b) here on Stack Overflow. – larsks Apr 05 '22 at 15:05

0 Answers0