0
votes

I'm trying to build an image from a Dockerfile in order to launch multiple containers from it. In the Dockerfile I copy my /etc/apt/source/sources.list and then execute several command (apt update, and apt install) using the RUN keyword.

When I execute the docker build command, the execution starts correctly and I see intermediary containers being created and deleted. But at some point I get an error telling me "Address already in use".

When I inspect the last intermediary container created, in the state section I get:

Status: created
...
Pid : 0
ExitCode: 128
Error: Adress already in use

EDIT:

The Dockerfile looks like this:

FROM i386/debian AS node

COPY sources.list /etc/apt/sources.list

RUN apt-get update
RUN apt-get install -y openssh-server
RUN apt-get install -y vim gdb valdgrind
RUN apt-get-install -y python

...

The last output I get from the build command is:

Step 4/37 : RUN apt-get update
 ----> Running in ce7722ffeeb6
Address already in use

END EDIT

I don't understand what this error is about. Does anybody have an idea?

I'm running on Debian 9 with Docker 17.12.0.

1
Please provide your Dockerfile and/or the last line of the docker build output, which should container the last executed Dockerfile statement, which causes the error - Murmel
I posted the Dockerfile and output - scoob27
Looks kind of odd, what is the content of your sources.list? Does the problem persist if you remove the COPY sources.list /etc/apt/sources.list line? Does your problem persist if you switch from FROM i386/debian to another base image, say FROM ubuntu? - Murmel

1 Answers

0
votes

This means that one of the ports that you affected to one of your containers is currently already used by another container or by another application on your machine.

A good example is if you are running your app both in a container with a port explicitely exposed by docker, and at the same time running it from your IDE.

If this does not make the problem for you can you paste us your dockerfile ?