Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

docker login; docker push fails #2

Open
gracecodes144 opened this issue Jun 29, 2015 · 5 comments
Open

docker login; docker push fails #2

gracecodes144 opened this issue Jun 29, 2015 · 5 comments

Comments

@gracecodes144
Copy link

Even after logging in, the docker push command tries to get authentication details interactively. Passing the details as a heredoc fails with a docker error about invalid ioctl. I believe this may be related to a breaking change in the docker hub auth API in version 1.7. Where does Circle CI stand on installing an updated docker version? My attempts to script it in my circle.yml have failed miserably...

@notnoopci
Copy link

Yeah - the containers by default run old Docker - we plan to update our containers with the latest Docker. For the time-being, can you try using the following commands to upgrade Docker (also please remove docker from machine.services):

machine:
  pre:
    - |
      sudo curl -L -o /usr/bin/docker 'http://s3-external-1.amazonaws.com/circle-downloads/docker-1.6.2-circleci'
      sudo chmod 0755 /usr/bin/docker
      sudo start docker

Let me know how it goes!

@gracecodes144
Copy link
Author

Yeah, I've got that version running in my Circle CI instances using the below circle.yml sections (found the previous ticket). Unfortunately, I'm still running into the same problem. I think there may have been some breaking changes in authentication with Docker Hub in the 1.7 release. Any idea of the timeline for docker 1.7 in the Circle CI environment? Any other suggestions?

machine:
  services:
    - docker

dependencies:
  pre:
    - sudo service docker stop && sudo curl -L -o /usr/bin/docker
      'http://s3-external-1.amazonaws.com/circle-downloads/docker-1.6.2-circleci'
      && sudo chmod 0755 /usr/bin/docker && sudo service docker start

@notnoopci
Copy link

Can you remove docker from machine.services section? I believe that should fix the problem.

We are working on supporting Docker 1.7 - should be coming relatively soon.

@gracecodes144
Copy link
Author

I'm getting the same problem even after removing docker from machine.services. Can you reproduce on a Circle CI instance where you believe it should work? The steps are simple, docker login followed by docker push.

@notnoopci
Copy link

I have reproduced the process with 1.6.2 here: https://circleci.com/gh/circleci/docker-elasticsearch/55 based on [1]. May I suggest reaching CircleCI support - our support engineers can dig into your build better and debug the issue.

[1] CircleCI-Archived/docker-elasticsearch@605732b

kimh pushed a commit that referenced this issue Nov 4, 2015
TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.

Quoting MkdirAll documentation:

> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.

This means two things:

1. If a directory to be created already exists, no error is returned.

2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.

The above is a theory, based on quoted documentation and my UNIX
knowledge.

3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.

Because of #1, IsExist check after MkdirAll is not needed.

Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.

Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.

[v2: a separate aufs commit is merged into this one]

[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
levlaz pushed a commit that referenced this issue Jun 25, 2016
Fix exec start api with detach and AttachStdin at same time. fixes #2
DominicLavery pushed a commit that referenced this issue Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants