Giter VIP home page Giter VIP logo

zephyr-container's Introduction

Zephyr Build Container

This repo is to create an image that is able to setup and use a Zephyr build environment.

The instructions will be slightly different depending on whether Linux, Windows or Mac is used. There are setup instructions for using Windows/Mac at https://github.com/crops/docker-win-mac-docs/wiki. When referring to Windows/Mac in the rest of the document, it is assumed the instructions at https://github.com/crops/docker-win-mac-docs/wiki were followed.

Running the container

  • Create workdir or volume

    • Linux

    The workdir you create will be used for all output from the Zephyr build system as well as where your workspace will be saved. You can either create a new directory or use an existing one.

    mkdir -p /home/myuser/workdir
    

    It is important that you are the owner of the directory. The owner of the directory is what determines the user id used inside the container. If you are not the owner of the directory, you may not have access to the files the container creates.

    For the rest of the instructions we'll assume the workdir chosen was /home/myuser/workdir.

  • Windows/Mac

    On Windows or Mac a workdir isn't needed. Instead the volume called myvolume will be used. This volume should have been created when following the instructions at https://github.com/crops/docker-win-mac-docs/wiki.

  • The docker command

    • Linux

    Assuming you used the workdir from above, the command to run a container for the first time would be:

    docker run --rm -it -v /home/myuser/workdir:/workdir crops/zephyr-container \
    --git "-b branch_name http://some/git/repo.git target_directory"
    
    • Mac
    docker run --rm -it -v myvolume:/workdir crops/zephyr-container \
    --git "-b branch_name http://some/git/repo.git target_directory"
    
    • Windows
    docker run --rm -it -v myvolume:/workdir crops/zephyr-container \
    --git "-b branch_name http://some/git/repo.git target_directory"
    

    Let's discuss some of the options:

    • --git "-b branch_name http://some/git/repo.git target_directory": This is the url of the Zephyr OS git repo. The kernel source will be automatically downloaded and prepared to use inside of the target_directory. Substitute in the url, branche_name and target_directory for whatever Zephyr OS git repo, branch and directory you want to use.

    You should see output similar to the following:

    Attempting to clone -b master https://gerrit.zephyrproject.org/r/zephyr zephyr-src
    Cloning into 'zephyr-src'...
    remote: Counting objects: 10518, done
    remote: Finding sources: 100% (98219/98219)
    remote: Total 98219 (delta 62422), reused 98006 (delta 62422)
    Receiving objects: 100% (98219/98219), 39.75 MiB | 2.87 MiB/s, done.
    Resolving deltas: 100% (62422/62422), done.
    Checking connectivity... done.
    zephyruser@e6fc72513005:/workdir$
    
    

    At this point you should be able to use the shell to build Zephyr apps.

    Source the project environment file to set the project environtment variables:

    $ cd ./zephyr-src
    

    Source the project environment file to set the project environtment variables:

    $ source zephyr-env.sh
    

    Build the example project, enter:

    $ cd $ZEPHYR_BASE/samples/hello_world/
    
    $ make
    
  • Using a previous workdir

    In the case where you have previously cloned the Zephyr git repo you will no longer need to specify the --git argument when starting the container.

    So the following command:

    docker run --rm -it -v /home/myuser/workdir:/workdir crops/zephyr-container
    

    on a previously setup workdir, should generate output similar to:

    zephyruser@a2968550e11d:/workdir$
    

Building the container image

If for some reason you want to build your own image rather than using the one on dockerhub, then run the command below in the directory containing the Dockerfile:

docker build -t crops/zephyr-container .

The argument to -t can be whatever you choose.

zephyr-container's People

Contributors

todorez avatar bavery22 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.