Docker 1.10.0 is available (Beta)

docker

#1

Note: this post is deprecated. We recommend all new project that require up-to-date Docker support use CircleCI 2.0: https://circleci.com/docs/2.0/


We now have Docker 1.10.0 working on CircleCI. You just need to add the following to your circle.yml.

machine:
  pre:
    - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0

  services:
    - docker

Note
As you may already know, we apply a small patch to Docker to run on CircleCI build machines. We use unprivileged LXC container to run customer’s builds and Docker doesn’t support unpriv LXC container. There is LXC exec driver but that only supports privileged LXC container, not unprivileged container.

Docker 1.10.0 release is very significant for us since it removes LXC exec driver and we needed to work on patching the native exec driver (libcontainer) so that it runs on unpriv LXC container.

We’ve done testings and confirmed that basic Docker features are working but if you find something broken, please let us know in the post.

:whale:


Docker 1.10 support?
Docker 1.9.1 is available
If the Docker socket is mounted a container fails to start
CircleCI pushing to Google Container Registry
Sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' $BUILD_NAME)" -- bash -c ./configure.sh lxc-attach: attach.c: lxc_attach: 713 failed to get the init pid
How to upgrade Docker server api version?
Unknown instruction: ARG
Support Docker versions newer than v1.9.1
Which docker repository is being used?
#2

Thank you. Docker 1.10.1 is released a few days ago. :grin:


#3

I am getting OSError: out of pty devices with new docker version;(


#4

Hello,

I have a problem with docker cp. Basically when I try to copy data into already stopped container it fails with Error response from daemon: Untar re-exec error: exit status 1: output: unexpected EOF. Locally I use docker 1.10.1 and it works without any problems.


#5

@eddwardo Thanks for reporting. Do you have docker command that I can reproduce the error?


#6

@mwolny Thanks for reporting. Do you have a docker command that I can reproduce the error?


#7

@mwolny actually never mind with my previous reply. I missed that you mentioned how to reproduce. I’ll try on my side and see if I can fix.


#8

Awesome, thanks! Would you mind to check docker cp with other versions available on CircleCI? I tried 1.9 and the default version and both of them returns Permission denined when you try to copy data into container.


#9

@mwolny I think you are hit by Unable to use "docker cp", but it worked 2 days ago

However, that was because of LXC driver and Docker 1.10 is not using LXC driver anymore, so I suppose that’s an different issue.


#10

Hi @mwolny following up your docker cp error. I’ve done a simple test but copy seems working for both direction (host -> container and container -> host).

My tests are running the following commands.

export n=test-cp && docker run --name $n ubuntu true && docker cp $n:/etc/hosts . && cat hosts
export n=test-cp && echo "hello" > hello.txt && docker cp hello.txt $n:/hello.txt

Do you have a command to reproduce the error?


#11

@kimh

Last login: Tue Feb 16 09:14:19 2016 from 10.159.149.97
(venv-2.7.6)ubuntu@box14:~$ docker run -it ubuntu bash
root@1027a705b092:/# apt-get install -y python
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python-minimal
  python2.7 python2.7-minimal
Suggested packages:
  python-doc python-tk python2.7-doc binutils binfmt-support
The following NEW packages will be installed:
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python
  python-minimal python2.7 python2.7-minimal
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 3734 kB of archives.
After this operation, 16.0 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libpython2.7-minimal amd64 2.7.6-8 [307 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main python2.7-minimal amd64 2.7.6-8 [1190 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main libpython2.7-stdlib amd64 2.7.6-8 [1872 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main libpython-stdlib amd64 2.7.5-5ubuntu3 [7012 B]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main python2.7 amd64 2.7.6-8 [197 kB]
Get:6 http://archive.ubuntu.com/ubuntu/ trusty/main python-minimal amd64 2.7.5-5ubuntu3 [27.5 kB]
Get:7 http://archive.ubuntu.com/ubuntu/ trusty/main python amd64 2.7.5-5ubuntu3 [134 kB]
Fetched 3734 kB in 0s (7042 kB/s)
E: Can not write log (Is /dev/pts mounted?) - openpty (2: No such file or directory)
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 11542 files and directories currently installed.)
Preparing to unpack .../libpython2.7-minimal_2.7.6-8_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.6-8) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../python2.7-minimal_2.7.6-8_amd64.deb ...
Unpacking python2.7-minimal (2.7.6-8) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../libpython2.7-stdlib_2.7.6-8_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.6-8) ...
Selecting previously unselected package libpython-stdlib:amd64.
Preparing to unpack .../libpython-stdlib_2.7.5-5ubuntu3_amd64.deb ...
Unpacking libpython-stdlib:amd64 (2.7.5-5ubuntu3) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.6-8_amd64.deb ...
Unpacking python2.7 (2.7.6-8) ...
Selecting previously unselected package python-minimal.
Preparing to unpack .../python-minimal_2.7.5-5ubuntu3_amd64.deb ...
Unpacking python-minimal (2.7.5-5ubuntu3) ...
Selecting previously unselected package python.
Preparing to unpack .../python_2.7.5-5ubuntu3_amd64.deb ...
Unpacking python (2.7.5-5ubuntu3) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Setting up libpython2.7-minimal:amd64 (2.7.6-8) ...
Setting up python2.7-minimal (2.7.6-8) ...
Linking and byte-compiling packages for runtime python2.7...
Setting up libpython2.7-stdlib:amd64 (2.7.6-8) ...
Setting up libpython-stdlib:amd64 (2.7.5-5ubuntu3) ...
Setting up python2.7 (2.7.6-8) ...
Setting up python-minimal (2.7.5-5ubuntu3) ...
Setting up python (2.7.5-5ubuntu3) ...
root@1027a705b092:/# python -c "import pty; print pty.openpty()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/pty.py", line 29, in openpty
    master_fd, slave_name = _open_terminal()
  File "/usr/lib/python2.7/pty.py", line 70, in _open_terminal
    raise os.error, 'out of pty devices'
OSError: out of pty devices

#12

@eddwardo I think I fixed the pty issue. Can you try again now?

You can see it’s working at https://circleci.com/gh/kimh/circleci-playground/48


#13

@kimh pty opening works. How about cache now? Should I do it like this?

    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - perl circle_docker_file_timestamp_fix.pl
    - docker build --build-arg CIRCLE_BUILD_NUM=$CIRCLE_BUILD_NUM -f Dockerfile-circleci -t env:latest .
    - mkdir -p ~/docker; docker save env:latest > ~/docker/image.tar 

If so, why caching doesn’t seem to work?


#14

Thanks for the Beta!
We’ve tried this out on our builds and it works except for caching.

Our builds use the docker load/save ~/docker/image.tar idiom.
With docker 1.9, docker build uses cached layers from image.tar.
With docker 1.10 (beta), docker build executes all commands in the Dockerfile every time, regardless of cache.


#15

Hi @pmbauer

It looks the caching does not work with load/save in 1.10. Please see the issue that I created.

There is an alternative way to use caching on CircleCI Caching Docker image with Docker Hub Maybe you can try this approach?


Caching Docker image with Docker Hub
#16

Since you’re switching off of LXC, are there any plans to support docker exec with this release? I get this error when I run docker exec with the 1.10 docker beta:

open /proc/self/oom_score_adj: no such file or directory

Exit Code 255 on all Docker exec commands
#17

@kimh Unfortunately, the docker pull approach (for using the docker cache) also no longer works with the 1.10 beta.


#18

@VikParuchuri I also love docker exec to work. I’ll give it a try sometime this week.


#19

@pmbauer You are right. docker pull doesn’t use cache either probably because of the same reason for docker load/save not working. Let me think what we can do here a bit.


#20

Holy cow, and I tried everything all day to fix this cache thing, I should have checked the forum…

Regarding caching:

  • load/save does not work
  • pull/push does not work
  • pull base image then build does not work

I’m all out of options, hope you find a solution!