-
Notifications
You must be signed in to change notification settings - Fork 95
Add Dockerfile and devcontainer.json #174
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
Merged
NeroBurner
merged 13 commits into
InfiniTimeOrg:main
from
dariusarnold:docker-devcontainer
Jun 16, 2025
Merged
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c7a841a
docker build instructions
kon-foo 65db236
docker builder image
kon-foo 20ba726
quiet flag; build env vars; remove apt-cache
kon-foo fd91208
Add Dockerfile and devcontainer.json
dariusarnold eb8e6da
Apply suggestions from code review
dariusarnold 3dcb80c
Use Ubuntu 24.04 for devcontainer
dariusarnold b0a10aa
Fix typo
dariusarnold 9f715de
Add gdb to allow debugging inside of the dev container
dariusarnold 99585fe
Set name of dev container bash history volume to infinisim-bashhistory
dariusarnold 2a188e6
Add a workaround for error "Status 500: unable to find user ubuntu: n…
dariusarnold c194851
Fix spelling, variable names, improve docs
dariusarnold 8d1224f
Remove copy-pasted hardware debugging extension
dariusarnold dfe0445
Fix variable capitalization completely
dariusarnold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| FROM ubuntu:22.04 | ||
|
|
||
| # Install dependencies | ||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| ARG NODE_MAJOR=20 | ||
| RUN apt-get update -qq && \ | ||
| apt-get install -y \ | ||
| curl \ | ||
| cmake \ | ||
| ccache \ | ||
| libsdl2-dev \ | ||
| g++ \ | ||
| git \ | ||
| libpng-dev \ | ||
| ninja-build \ | ||
| sudo \ | ||
| python3-pip \ | ||
| python3-venv \ | ||
| && rm -rf /var/cache/apt/* /var/lib/apt/lists/* \ | ||
| && curl -sL https://deb.nodesource.com/setup_${NODE_MAJOR}.x -o nodesource_setup.sh \ | ||
| && bash nodesource_setup.sh \ | ||
|
dariusarnold marked this conversation as resolved.
|
||
| && apt-get install -y nodejs \ | ||
| && npm install -g lv_font_conv@1.5.2 \ | ||
| && pip install wheel Pillow | ||
|
|
||
| # Add the infinitime user with sudo password "it" for developing in devcontainer | ||
| RUN adduser infinitime && echo "infinitime:it" | chpasswd && usermod -aG sudo infinitime | ||
|
|
||
| # Persist bash history across container rebuilds | ||
| # Reference: https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history | ||
| ARG USERNAME=infinitime | ||
| RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \ | ||
| && mkdir /commandhistory \ | ||
| && touch /commandhistory/.bash_history \ | ||
| && chown -R $USERNAME /commandhistory \ | ||
| && echo "$SNIPPET" >> "/home/$USERNAME/.bashrc" | ||
|
|
||
| USER infinitime | ||
|
|
||
| # Section for interactive compilation during docker run | ||
|
|
||
| WORKDIR /sources | ||
| # Directory if InfiniTime source code | ||
|
dariusarnold marked this conversation as resolved.
|
||
| ENV INFITIME_DIR="/sources/InfiniTime" | ||
|
dariusarnold marked this conversation as resolved.
Outdated
|
||
| # Passed to CMake generate step | ||
| ENV GENERATE_ARGS="" | ||
| # Passed to CMake build step | ||
| ENV BUILD_ARGS="" | ||
| # Build directory | ||
| ENV BUILD_DIRECTORY="build" | ||
|
|
||
| CMD ["bash", "-c", "cmake -S . -B ${BUILD_DIRECTORY} -G Ninja -DInfiniTime_DIR=${INFITIME_DIR} ${GENERATE_ARGS} && cmake --build ${BUILD_DIRECTORY} ${BUILD_ARGS}"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // For format details, see https://aka.ms/devcontainer.json. | ||
| { | ||
| "name": "InfiniSim Dev Container", | ||
| "build": { | ||
| "dockerfile": "Dockerfile" | ||
| }, | ||
|
|
||
| // Configure tool-specific properties. | ||
| "customizations": { | ||
| "vscode": { | ||
| // Add the IDs of extensions you want installed when the container is created. | ||
| "extensions": [ | ||
| "ms-vscode.cpptools", | ||
| "ms-vscode.cmake-tools", | ||
| "marus25.cortex-debug", | ||
|
dariusarnold marked this conversation as resolved.
Outdated
|
||
| "notskm.clang-tidy", | ||
| "mjohns.clang-format", | ||
| "timonwong.shellcheck" | ||
| ] | ||
| } | ||
| }, | ||
|
|
||
| "mounts": [ | ||
| // Local volume to store bash history across rebuilds | ||
| "source=projectname-bashhistory,target=/commandhistory,type=volume" | ||
|
dariusarnold marked this conversation as resolved.
Outdated
|
||
| // Uncomment and modify path to mount external InfiniTime source into the container | ||
| //,"source=/home/example/git/InfiniTime,target=/workspaces/InfiniTime,type=bind,consistency=cached" | ||
| ], | ||
|
|
||
| // Sudo password "it" | ||
| "remoteUser": "infinitime" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.