“Error: open /tmp/docker-import-123456789/repo/bin/json: no such file or directory”

I’ve been trying to create a minimal docker image for RHEL versions, for one of my projects. The following were the steps I followed:

a) Installed a RHEL6.5 server with ‘Minimal Installation’.

b) Registered it to the local satellite.

c) Created a tar-ball of the filesystem with the command below:

# tar --numeric-owner --exclude=/proc --exclude=/sys --exclude=/mnt --exclude=/var/cache

--exclude=/usr/share/doc --exclude=/tmp --exclude=/var/log -zcvf /mnt/rhel6.5-base.tar.gz /

d) Load the tar.gz image using ‘docker load’ (as per the man page of ‘docker load’)

# docker load -i rhel6.5-base.tar.gz

This is where it erred with the message:

2014/08/16 20:37:42 Error: open /tmp/docker-import-123456789/repo/bin/json: no such file or directory

After a bit of searching and testing, I found that ‘docker load -i’ doesn’t work as expected. The workaround is to cat and pipe the tar.gz file, as shown below:

# cat rhel6.5-base.tar.gz | docker import - rhel6/6.5

This ends up with the image showing up in ‘docker images’

# docker images

REPOSITORY   TAG    IMAGE ID           CREATED                  VIRTUAL SIZE
 rhel6/6.1           latest  32b4b345454a  About a minute ago 1.251 GB

Update: ‘docker load -i <image-file>’ would only work if the image is created as a layered docker image. If the <image-file> is a tar ball created from a root filesystem, you would need to use ‘cat <image-file> | docker import <name>’

7 thoughts on ““Error: open /tmp/docker-import-123456789/repo/bin/json: no such file or directory”

  1. Have you check the image you load via “docker import”?
    I use your method but have problem to run this kind of docker images

    1. Chen, thank you for your pointer. This was done at least 2 years back while testing out docker.

      Back then, it was not even in 1.0. This may not be the case with the current version.

  2. hi man,
    thanks for your post, and i knew it back to two years ago, bout have you done any activity for now?
    or any suggest, many thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s