Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
packages: write
#
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.12.0
- name: Checkout repository
uses: actions/checkout@v4
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
Expand All @@ -46,5 +48,6 @@ jobs:
with:
context: ./dev/
push: true
platforms: linux/arm64,linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
31 changes: 22 additions & 9 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ubuntu:latest

ARG TARGETPLATFORM

# Set up container and time zones
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive TZ="America/New_York" \
Expand Down Expand Up @@ -30,13 +32,13 @@ RUN pip install --break-system-packages grpcio-tools

RUN wget https://github.com/renode/renode/releases/download/v1.15.3/renode-1.15.3.linux-portable.tar.gz
RUN mkdir renode_portable && tar -xvf renode-*.linux-portable.tar.gz -C renode_portable --strip-components=1 && rm renode-*.linux-portable.tar.gz
ENV PATH $PATH:/renode_portable
ENV PATH=$PATH:/renode_portable

RUN wget https://github.com/ThrowTheSwitch/CMock/archive/refs/tags/v2.6.0.tar.gz -O cmock.tar.gz
RUN mkdir cmock_portable && tar -xvf cmock.tar.gz -C cmock_portable --strip-components=1 && rm cmock.tar.gz
ENV PATH $PATH:/cmock_portable
ENV PATH=$PATH:/cmock_portable

RUN wget https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.6.1.tar.gz -O unity.tar.gz
RUN wget https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.6.1.tar.gz -O unity.tar.gz
RUN mkdir -p /cmock_portable/vendor/unity && tar -xvf unity.tar.gz -C /cmock_portable/vendor/unity --strip-components=1 && rm unity.tar.gz

# Set up a development tools directory
Expand All @@ -51,16 +53,27 @@ RUN echo "source /home/dev/scripts/alias.sh" >> ~/.bashrc
RUN ln -sf /usr/lib/linux-tools-*/* /usr/bin/

# Install cross compiler
RUN wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz | tar -xJv
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-aarch64-arm-none-eabi.tar.xz | tar -xJv; \
else \
wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz | tar -xJv; \
fi

ENV PATH $PATH:/home/dev/arm-gnu-toolchain-11.3.rel1-aarch64-arm-none-eabi/bin
ENV PATH $PATH:/home/dev/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin

# build and install customized openocd
RUN apt-get install -y libtool libusb-1.0.0-dev
RUN git clone https://github.com/STMicroelectronics/OpenOCD
RUN cd ./OpenOCD && ./bootstrap && ./configure --enable-stlink
RUN cd ./OpenOCD && make && make install
RUN rm -r ./OpenOCD
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
apt-get install -y libtool libusb-1.0.0-dev && \
git clone https://github.com/STMicroelectronics/OpenOCD && \
cd ./OpenOCD && \
./bootstrap && \
./configure --enable-stlink && \
make && \
make install && \
cd .. && \
rm -r ./OpenOCD; \
fi

WORKDIR /home/app

Expand Down
Loading