Welcome to the Linux Foundation Forum!

lab 6.1 busybox.tar

I am having problems with file busybox.tar. I checked and it said that it was empty so I decided to start the lab over and in doing so I got stuck on the second command instead of the third.

The errors I received the first time:

student@ubuntu:~$ mkdir -p runc-container/rootfs
student@ubuntu:~$ docker container export \ $(docker container create busybox) \ > busybox.tar
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
809d8e20e203: Pull complete
Digest: sha256:2376a0c12759aa1214ba83e771ff252c7b1663216b192fbe5e0fb364e952f85c
Status: Downloaded newer image for busybox:latest
"docker container export" requires exactly 1 argument.
See 'docker container export --help'.

Usage: docker container export [OPTIONS] CONTAINER

Export a container's filesystem as a tar archive
student@ubuntu:~$ tar -C runc-container/rootfs/ -xf busybox.tar
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
student@ubuntu:~$ file busybox.tar
busybox.tar: empty

The errors I am receiving now after starting over:

student@ubuntu:~$ docker container export \ $(docker container create busybox) \ > busybox.tar
"docker container export" requires exactly 1 argument.
See 'docker container export --help'.

Usage: docker container export [OPTIONS] CONTAINER

Export a container's filesystem as a tar archive

Comments

  • luisviveropena
    luisviveropena Posts: 1,252

    We were able to fix the issue on LFS253 Office Hours :)

    1.- Tried the commands on the student VM with Ubuntu 20.04 and failed.
    2.- Tried the commands on my VM with Ubuntu 22.04 and worked.
    3.- Installed a cloud VM with Ubuntu 22.04 and failed. So we had some issues related to permissions and modified the docker command to this:

    sudo docker container export $(sudo docker container create busybox) > busybox.tar

    Note that sudo in the second docker command is needed too.

    And it worked (Christy haven't configured the system to allow a non root user to run docker yet).

    Christy was going to see if the solution works on Ubuntu 20.04 as well.

    Regards,
    Luis.

  • chrispokorni
    chrispokorni Posts: 2,376

    Hi @christyww and @luisviveropena,

    Thanks for your feedback and troubleshooting details.

    Indeed, the labs were written and tested on Ubuntu 20.04 (on both local VirtualBox VM and Google Cloud GCE VM). With all permissions in place as set in lab 4.3, the lab reported above worked as described. However, as both Docker and Ubuntu mature, changes can be expected, eventually impacting the behavior of the lab exercises.

    Please try lab 6.1 on the recommended Ubuntu release and docker permissions from lab 4.3.

    Regards,
    -Chris

  • christyww
    christyww Posts: 8

    The solution worked on ubuntu 20.04 as well!

  • luisviveropena
    luisviveropena Posts: 1,252

    That's good @christyww!

    It's a pleasure @chrispokorni :)

    Regards,
    Luis.

Categories

Upcoming Training