2 Replies Latest reply on Apr 4, 2016 12:03 AM by jcuzella

    docker run compile/edison

    @hippiehacker

      TLDR;

      docker run -ti --volume=`pwd`:/edison-src -w /edison-src compile/edison make

       

      It's still coming together, but I'm trying to make it super easy for folks to start from src and get an image.

      https://github.com/ii/meta-edison-ii/tree/master/docker/yocto/edison

       

      Release 2.1 · ii/edison-src · GitHub

       

      The above release includes the edison-image-edison.ext4.tar.gz from this snippit:

      $ unzip edison-image-ww18-15.zip
      $ ls -lah edison-image-edison.ext4
      -rw-r--r-- 1 hh hh 512M May 8 22:05 edison-image-edison.ext4
      $ sudo mount -o loop edison-image-edison.ext4 /mnt
      $ cd /mnt
      $ sudo tar cvfz /tmp/edison-image-edison.ext4.tar.gz .
      # edison-image-edison.ext4.tar.gz is attached below
      $ docker import -t yocto/edison:ww18-15 < /tmp/edison-image-edison.ext4.tar.gz
      # optionally I push it to dockerhub
      $ docker push yocto/edison:ww18-15

       

      Which I used as a base for a Dockfile that looks like this:

       

      FROM yocto/edison:ww18-15

      ADD base-feeds.conf /etc/opkg/

      RUN opkg update

       

      # most of the software we need to compile stuff

      RUN opkg install python-pip bluez5-obex bluez5-dev bluez5-testtools bluez-hcidump \

      bash bison coreutils diffutils e2fsprogs elfutils findutils git iw less libevent-dev lirc \

      nodejs opkg-utils quilt rsync ruby-staticdev screen syslinux tar tcpdump time \

      util-linux-uuidgen uuid vim

       

      # python stuff for bluez

      RUN curl https://bootstrap.pypa.io/ez_setup.py | python

      RUN pip install ipython && pip install evdev && pip install PyBluez

      # RUN pip install dbus-python # IOError: [Errno 2] No such file or directory: '/tmp/pip-build-root/dbus-python/setup.py'

       

      # emacs is a must

      RUN cd /tmp && wget -O - http://mirrors.ibiblio.org/gnu/ftp/gnu/emacs/emacs-24.5.tar.gz \

      | tar xfz - && cd /tmp/emacs-24.5 && ./configure --without-x && make -j 11 install \

      && cd /tmp && rm -rf /tmp/emacs-24.5

       

      # cpio is required

      RUN cd /tmp && wget -O - wget http://ftp.gnu.org/gnu/cpio/cpio-2.11.tar.gz \

      | tar xfz - && cd /tmp/cpio-2.11 && sed -i -e '/gets is a/d' gnu/stdio.in.h \

      && ./configure --enable-mt && make -j 12 install

       

      Which I pushed to dockerhub as compile/edison:

       

      $ docker build -t compile/edison .
      $ docker push compile/edison # optionally push to dockerhub
      $ docker images
      REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
      compile/edison latest 7525790f6dd3 15 minutes ago 655.9 MB
        • 1. Re: docker run compile/edison
          @hippiehacker

          I suspect you could docker export > /path/to/edison-image-edison.ext4.tar.gz and recreate/update the image as well with a bit of plumbing.

          • 2. Re: docker run compile/edison
            jcuzella

            Not sure if I'm going about it the right way in 2016 by using this image... but I'm getting some errors when trying "make setup" and "make" in the provided image from Docker Hub:

             

            bash-4.3# make
            /bin/bash -c "source out/current/poky/oe-init-build-env /edison-src/out/current/build ; bitbake -c cleansstate edison-image ; bitbake edison-image"
            
            
            ### Shell environment set up for builds. ###
            
            
            You can now run 'bitbake <target>'
            
            
            Common targets are:
                core-image-minimal
                core-image-sato
                meta-toolchain
                adt-installer
                meta-ide-support
            
            
            You can also run generated qemu images with a command like 'runqemu qemux86'
            ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
                Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
                Following is the list of potential problems / advisories:
            
            
                Do not use Bitbake as root.
            ERROR: Execution of event handler 'check_sanity_eventhandler' failed
            ERROR: Command execution failed: Exited with 1
            
            
            Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
            ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
                Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
                Following is the list of potential problems / advisories:
            
            
                Do not use Bitbake as root.
            ERROR: Execution of event handler 'check_sanity_eventhandler' failed
            ERROR: Command execution failed: Exited with 1
            
            
            Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
            Makefile:49: recipe for target 'edison-image' failed
            make: *** [edison-image] Error 1
            

             

            So first off, it doesn't like running as the root user in the container.  Ok, that's fine... let's create one and try again:

             

            bash-4.3# useradd -M -d /edison-src/ -s /bin/bash -U bitbaker
            bash-4.3# su - bitbaker
            bitbaker@71c79a4817a9:~$ pwd
            /edison-src/
            bitbaker@71c79a4817a9:~$ make
            /bin/bash -c "source out/current/poky/oe-init-build-env /edison-src/out/current/build ; bitbake -c cleansstate edison-image ; bitbake edison-image"
            
            
            ### Shell environment set up for builds. ###
            
            
            You can now run 'bitbake <target>'
            
            
            Common targets are:
                core-image-minimal
                core-image-sato
                meta-toolchain
                adt-installer
                meta-ide-support
            
            
            You can also run generated qemu images with a command like 'runqemu qemux86'
            WARNING: Host distribution "Unknown" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
            ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
                Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
                Following is the list of potential problems / advisories:
            
            
                Please install the following missing utilities: makeinfo,chrpath
            The TMPDIR: /edison-src/out/linux64/build/tmp can't be located on nfs.
            
            
            ERROR: Execution of event handler 'check_sanity_eventhandler' failed
            ERROR: Command execution failed: Exited with 1
            
            
            Summary: There was 1 WARNING message shown.
            Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
            WARNING: Host distribution "Unknown" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
            ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
                Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
                Following is the list of potential problems / advisories:
            
            
                Please install the following missing utilities: makeinfo,chrpath
            The TMPDIR: /edison-src/out/linux64/build/tmp can't be located on nfs.
            
            
            ERROR: Execution of event handler 'check_sanity_eventhandler' failed
            ERROR: Command execution failed: Exited with 1
            
            
            Summary: There was 1 WARNING message shown.
            Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
            Makefile:49: recipe for target 'edison-image' failed
            make: *** [edison-image] Error 1
            

             

             

            So from the looks of it, we have a sort of chicken-egg problem due to some missing build dependencies: makeinfo, chrpath

             

            However, this being an image based on Intel Edison's Yocto image, we are stuck with opkg and no precompiled packages for these.  Would have to build them from scratch & retry... but I thought the idea was that they'd either be part of the image to start the build from, or bootstrap themselves when I ran make.  After going down a rabbit hole of learning about the Yocto project and how to get started with it, it seems that building within the Intel Edison Yocto image may not be the best idea after all.  Seems it might be easier to start from a more fully-featured host OS such as Fedora / RHEL, Ubuntu, or OpenSuse.  Thoughts?