Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerised development environment helper #50

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mawildoer
Copy link

@mawildoer mawildoer commented Nov 5, 2023

Why?

I found it difficult to get started developing moteus firmware.

I want to make it easier on not just myself, but those who come after me to make improvements to this awesome project :)

How?

This adds a simple docker container + script to trivially spin up an assured (native if available, else emulated) x86_64 Ubuntu environment

Validation

Appears to work on my M1 Mac. Will need to verify a little more thoroughly though.

Screenshot 2023-11-05 at 14 16 13

@@ -9,3 +9,6 @@ fw/BUILD/
fw/.mbedignore

/bazel-*

.DS_Store
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably deserve reordering

@@ -0,0 +1,16 @@
FROM ubuntu
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be pinned down a smidge more tightly


RUN apt-get update
RUN apt-get install -y python3-pep517 python3-can python3-serial python3-setuptools python3-pyelftools python3-qtpy python3-wheel libtinfo5
RUN apt-get install -y curl patch git
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These deps should be on a single line

RUN apt-get install -y python3-pep517 python3-can python3-serial python3-setuptools python3-pyelftools python3-qtpy python3-wheel libtinfo5
RUN apt-get install -y curl patch git

# RUN addgroup --gid $GROUP_ID user
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is required for Linux to avoid leaving root turds around the place.
I'm not entirely sure off the bat how best do deal with the differences in OSx vs. Linux on this one.

Additionally, I think there's some potential Windows complications too, but I'm less familiar with them.

For OSx specifically, enabling the option "Use Rosetta for x86/amd64 emulation on Apple Silicon" should vastly improve performance.


## Usage
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO write usage instructions


mkdir -p "$CACHE_DIR"

docker build -t myimage \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be naming it something (at least as trivial as myimage), and should instead reference the freshly built image via it's tag.

Likely convert this to docker build -q, though I will miss the output in case of failures.

@mawildoer mawildoer mentioned this pull request Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant