Skip to content

Remote docker build fails on "RUN yum ..." #229

Closed

Description

@eembsen

Consider the following Docker file:

FROM centos
MAINTAINER Fly MacPara noreply@some.domain
RUN yum install -y openssh-server
RUN mkdir /var/run/sshd
CMD "/usr/sbin/sshd -D"

The command "docker build --no-cache=true --rm=true -t mycontainer" . on CoreOS runs fine. The new image is created.

Running the same docker build remotely against the docker daemon in CoreOS using the latest docker py ends in a failure. The code is like this:

c = docker.Client(base_url='http://172.16.116.199:4243', version='1.9', timeout=10)
print c.build(path='context', tag='mycontainer', nocache=True, rm=True)

The docker logs on CoreOS show:

May 27 05:53:15 localhost docker[3062]: [debug] buildfile.go:195 Command to be executed: [/bin/sh -c yum install -y openssh-server]
May 27 05:53:15 localhost docker[3062]: [e4e292ea] +job allocate_interface(e7369d464279fe75cd0e77081cb5832e9d09c0417533ca67719fc7dfc91473f8)
May 27 05:53:15 localhost docker[3062]: [debug] attach.go:59 attach: stdout: begin
May 27 05:53:15 localhost docker[3062]: [debug] attach.go:97 attach: stderr: begin
May 27 05:53:15 localhost docker[3062]: [debug] attach.go:143 attach: waiting for job 1/2
May 27 05:53:15 localhost docker[3062]: [e4e292ea] -job allocate_interface(e7369d464279fe75cd0e77081cb5832e9d09c0417533ca67719fc7dfc91473f8) = OK (0)
May 27 05:53:16 localhost docker[3062]: [error] attach.go:73 attach: stdout: write tcp 172.16.116.200:52015: connection reset by peer
May 27 05:53:16 localhost docker[3062]: [debug] attach.go:76 attach: stdout: end
May 27 05:53:16 localhost docker[3062]: [error] attach.go:145 attach: job 1 returned error write tcp 172.16.116.200:52015: connection reset by peer, aborting all jobs
May 27 05:53:16 localhost docker[3062]: [debug] attach.go:114 attach: stderr: end
May 27 05:53:16 localhost docker[3062]: write tcp 172.16.116.200:52015: connection reset by peer
May 27 05:53:16 localhost docker[3062]: [e4e292ea] -job build() = ERR (1)

Why? Why is the remote build failing whereas the local build succeeds? When I take out the line "RUN yum ..." in the Dockerfile above, the remote docker build runs and the container is created.

Activity

  1. eembsen commented on May 27, 2014

    @eembsen
    Author

    Looking at the logs more closely I now see that the IP address in the "connection reset by peer" is the IP address from the client that runs docker py function c.build.

  2. eembsen commented on May 27, 2014

    @eembsen
    Author

    BTW, logged the same issue in the docker project (moby/moby#6050) because I do not know which end is causing the trouble.

  3. changed the title [-]Remote docker build (on CoreOS) fails on "RUN yum ..."[/-] [+]Remote docker build fails on "RUN yum ..."[/+] on May 27, 2014
  4. mpetazzoni commented on May 27, 2014

    @mpetazzoni
    Contributor

    Could it be a timeout issue? What if you have RUN sleep 11 in your Dockerfile?

  5. eembsen commented on May 28, 2014

    @eembsen
    Author

    I played around with timeout settings but AFAIK that has no effect on the outcome.

  6. shin- commented on Jun 20, 2014

    @shin-
    Contributor

    Tried reproducing this today with Docker 1.0 and the current master but I didn't encounter the issue again. Are you still seeing this?

  7. shin- commented on Jul 22, 2014

    @shin-
    Contributor

    Closing, feel free to reopen if you're still seeing the issue with docker-py>=0.3.2 :)

  8. added a commit that references this issue on Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions