Skip to content

Commit

Permalink
Added a Dockerized build environment (#675)
Browse files Browse the repository at this point in the history
* added a dockerized build environment

* addressed review comments
  • Loading branch information
michaelkamprath authored Feb 24, 2023
1 parent c21611b commit 22fd6e7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ output/**
.vscode
node_modules
Debug*/**
libs_for_simulator/**
libs_for_simulator/**

# MacOS ignores
.DS_Store

1 change: 1 addition & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ You would need `nodejs` if you plan on making JavaScript/styling changes. This i
Gulp tasks should automatically appear in Explore pane in Visual Code. They can also be invoked from console by running `gulp`.

# Building
A Docker-ized build environment can be used to perform these builds. Instructions for doing so are [available here](./docker/README.md).

## Building for BK7231T

Expand Down
12 changes: 12 additions & 0 deletions docker/Dockerfile.BK7231x_build_env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
ARG USERNAME=devuser

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
wget git python3 python-is-python3 libc6-i386 \
make npm

RUN useradd -m -s /bin/bash ${USERNAME}
23 changes: 23 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Docker Files for OpenBK7231T_App

## Build Environment for BK7231T and BK7231N
The `Dockerfile.BK7231x_build_env` file can be used to create a consistent Linux-based environment for building OpenBK7231T_App for the `BK7231T` and `BK7231N` platforms. This allows you to build OpenBK7231T_App on any flavor of Linux and MacOS. This should also work on Windows, but is untested.

To build the image, run from within this directory:
```sh
docker build -t openbk7231x_build --build-arg USERNAME=$USER -f Dockerfile.BK7231x_build_env .
```

The `cd` to the root of the `OpenBK7231T` or `OpenBK7231N` SDK repo that has been set up [as described in the build instructions](https://github.com/michaelkamprath/OpenBK7231T_App/blob/main/BUILDING.md), and then start a shell prompt in the built Docker image, that binds the SDK repo as a volume in the Docker image:

```sh
docker run -it -v "$(pwd)/":/home/$USER/OpenBK7231T --user $USER openbk7231x_build /bin/bash
```
Change the `OpenBK7231T` directory name in the volume mount to `OpenBK7231N` if you are building for the `OpenBK7231N` platform.

Finally, at the Docker image's shell prompt, execute the following to build:
```sh
cd ~/OpenBK7231T/
./b.sh
```
Again, change the `OpenBK7231T` directory name to `OpenBK7231N` if you are building for that platform. Also, the last command may be changed to the advanced build's `build_app.sh` command as described in [the build instructions](https://github.com/michaelkamprath/OpenBK7231T_App/blob/main/BUILDING.md#building-for-bk7231t). The build results will be placed into the host computer's file system as described in the build instructions. To exit the Docker image's shell prompt when the build is done, use the `exit` command.

0 comments on commit 22fd6e7

Please sign in to comment.