Skip to content

Repository files navigation

20241230 fekerr & copilot

NOTE: this is a work in progress and may be on hold indefinitely (20241230).

Copiloted project: Here’s a quick guide to set up a Docker container to play with RTIC on an embedded Rust environment.

Step-by-Step Guide to Create a Docker Container for RTIC

  1. Install Docker:

    • Ensure Docker is installed on your system. If not, you can download and install it from the Docker website.
  2. Create a Dockerfile:

    • Create a new directory for your project and navigate into it.
    • Create a file named Dockerfile with the following content:
# Use the official Rust image as a base
FROM rust:latest

# Install dependencies
RUN apt-get update && apt-get install -y \
    gcc \
    gdb-multiarch \
    llvm \
    libclang-dev \
    libstdc++-10-dev \
    binutils-arm-none-eabi \
    gcc-arm-none-eabi \
    gdb-arm-none-eabi \
    openocd

# Create a directory for the project
WORKDIR /usr/src/app

# Copy the current directory contents into the container at /usr/src/app
COPY . .

# Install cargo-generate and cargo-binutils
RUN cargo install cargo-generate cargo-binutils

# Setup cargo binutils
RUN rustup component add llvm-tools-preview

# Setup default toolchain
RUN rustup default stable

# Create a new RTIC project
RUN cargo generate --git https://github.com/rtic-rs/app-template.git --name my-rtic-app

# Set the working directory to the newly created RTIC app
WORKDIR /usr/src/app/my-rtic-app

# Build the RTIC app
RUN cargo build

CMD ["bash"]
  1. Build the Docker Image:

    • In your terminal, navigate to the directory containing the Dockerfile.
    • Run the following command to build the Docker image:
    docker build -t rtic-env .
  2. Run the Docker Container:

    • Once the image is built, run a Docker container using the following command:
    docker run -it rtic-env
  3. Play with RTIC:

    • Inside the Docker container, you can navigate to the my-rtic-app directory and start playing with RTIC.
    • Use cargo build to build your project and cargo run to run it.

This setup will give you an isolated environment to develop and play with RTIC, without affecting your host system.

Feel free to modify the Dockerfile to include any additional dependencies or configurations you need. If you encounter any issues or have further questions, let me know! 😊🚀

Is there anything else you’d like to work on or discuss? 😊🚀

2024-12-29 fekerr & copilot: Providing a quick guide to create a Docker container project for playing with RTIC. Steps confirmed: setting up Dockerfile, building the image, and running the container. Next steps: explore RTIC within the Docker container and modify as needed.**

About

RTIC Rust RTOS docker file (attribution: Copilot)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages