Docker Community Forums

Share and learn in the Docker community.

Dockerising an embedded distro

Hello,

I’m trying to dockerise a linux real-time distro (~750MB) which is depolyed on embeded decvices. I’ve managed to get an ISO file of the distro and spin up a VM in virtal box. From there i’ve made an img.tar of the file system which i’ve then layed onto the scratch base image in a docker file to build the image. Later i plan on stripping the image to make it smaller and more docker like.

Docker file:
FROM scrach

img.tar /

I can create and bash into a container after building the dockerfile.

docker build -t myimage .

The distro includes a web server for setting up system variables and also has discovery services that use tcp and udp ports. I’ve mapped these to the host.

docker run --name mycontainer --rm -dt -p 44515:44515/udp -p 44525:44525/udp -p 45515:45515/tcp -p 3079:3079/tcp -p 3580:3580/tcp -p 8080:8080 -p 3537:3537/tcp -p 20:20/tcp -p 21:21/tcp -p 123:123/tcp -p 2324:2343/tcp -p 6000:6000/udp -p 59112:59112/tcp myimage bash

My issue is i can’t seem to ping the container or connact to any of the services/ports that should be open and running? Am I doing something stupid?

Using Docker Desktop i can CLI into the conatianer and run ifconfig which returns tthe following:

eth0 Link encap:Ethernet HWaddr 02:42:AC:11:00:03
inet addr:172.17.0.3 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1076 (1.0 KiB) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Is this the correct way of making a new docker image based on an existing OS and connecting to it?

Many thanks!