improve docker dev setups ; add rpi support ; the rpi stuff is compatible with docker and podmon
This commit is contained in:
parent
64aac2a020
commit
4e73a2ebeb
5 changed files with 81 additions and 0 deletions
40
.devcontainer/Dockerfile.rpi
Normal file
40
.devcontainer/Dockerfile.rpi
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
FROM ubuntu:latest as base
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
git \
|
||||||
|
wget \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
build-essential \
|
||||||
|
bzip2 \
|
||||||
|
ccache \
|
||||||
|
device-tree-compiler \
|
||||||
|
dfu-util \
|
||||||
|
g++ \
|
||||||
|
gcc \
|
||||||
|
gcc-arm-none-eabi \
|
||||||
|
libtool \
|
||||||
|
make \
|
||||||
|
ninja-build \
|
||||||
|
cmake \
|
||||||
|
python3-dev \
|
||||||
|
python3-pip \
|
||||||
|
python3-setuptools \
|
||||||
|
xz-utils \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* && apt-get clean
|
||||||
|
|
||||||
|
FROM base as dev
|
||||||
|
RUN apt-get update && apt-get install -y nano vim emacs tmux htop tio minicom \
|
||||||
|
&& pip3 install --user -U west \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* && apt-get clean
|
||||||
|
|
||||||
|
COPY bashrc tmp
|
||||||
|
RUN mv /tmp/bashrc ~/.bashrc
|
||||||
|
|
||||||
|
WORKDIR /workspaces
|
||||||
|
|
||||||
|
ENV ZEPHYR_TOOLCHAIN_VARIANT=cross-compile
|
||||||
|
ENV CROSS_COMPILE=/usr/bin/arm-none-eabi-
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
export LS_OPTIONS='-F --color=auto'
|
export LS_OPTIONS='-F --color=auto'
|
||||||
|
export PATH=~/.local/bin:${PATH}
|
||||||
alias ls='ls $LS_OPTIONS'
|
alias ls='ls $LS_OPTIONS'
|
||||||
if [ "${CODESPACES}" = "true" ]; then
|
if [ "${CODESPACES}" = "true" ]; then
|
||||||
export WORKSPACE_DIR="$HOME/workspace/zmk"
|
export WORKSPACE_DIR="$HOME/workspace/zmk"
|
||||||
|
|
11
docker_dev.sh
Executable file
11
docker_dev.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
docker run -it \
|
||||||
|
--name zmk-ardux-dev \
|
||||||
|
--network host \
|
||||||
|
--privileged \
|
||||||
|
-v /dev:/dev \
|
||||||
|
-v zmk:/workspaces/zmk \
|
||||||
|
-v ./:/workspaces/zmk-ardux \
|
||||||
|
-v ./.build:/workspaces/zmk/app/build \
|
||||||
|
zmk-ardux:latest \
|
||||||
|
/bin/bash
|
26
docker_setup_rpi.sh
Executable file
26
docker_setup_rpi.sh
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
docker volume create zmk
|
||||||
|
|
||||||
|
cd .devcontainer
|
||||||
|
|
||||||
|
docker build --network host -t zmk-ardux:latest -f ./Dockerfile.rpi
|
||||||
|
|
||||||
|
docker run --rm \
|
||||||
|
--network host \
|
||||||
|
-v zmk:/workspaces/zmk \
|
||||||
|
zmk-ardux:latest \
|
||||||
|
/bin/bash -c "git clone https://github.com/zmkfirmware/zmk /workspaces/zmk/"
|
||||||
|
|
||||||
|
docker run \
|
||||||
|
--name zmk-ardux-setup \
|
||||||
|
--network host \
|
||||||
|
-v zmk:/workspaces/zmk \
|
||||||
|
zmk-ardux:latest \
|
||||||
|
/bin/bash -c "source ~/.bashrc && cd /workspaces/zmk && west init -l app/ && west update && west zephyr-export && pip3 install --user -r zephyr/scripts/requirements-base.txt"
|
||||||
|
|
||||||
|
docker commit zmk-ardux-setup zmk-ardux:latest
|
||||||
|
|
||||||
|
docker rm -f zmk-ardux-setup
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
3
docker_snapshot.sh
Executable file
3
docker_snapshot.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker commit zmk-ardux-setup zmk-ardux:latest
|
Loading…
Reference in a new issue