Skip to content

Commit

Permalink
feat(ncs): append manager's env vars to the bashrc
Browse files Browse the repository at this point in the history
instead of using entrypoint call, since it doesn't always work.
  • Loading branch information
MarkoSagadin committed Oct 10, 2024
1 parent 6026d71 commit b10fe38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Changed

- ncs-zephyr Docker image now adds environment variables of the toolchain-manager to the bashrc file
to provide access to the installed tools. Previously that was done by the `ENTRYPOINT` command,
however that approach didn't always work with VSCode's Dev Containers.

## [1.5.0] - 2024-09-24

### Added
Expand Down Expand Up @@ -74,4 +80,5 @@ All below changes are related to the ncs-zephyr Docker image:
[1.2.0]: https://github.com/IRNAS/irnas-docker-software/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/IRNAS/irnas-docker-software/compare/v1.0.1...v1.1.0
[1.0.1]: https://github.com/IRNAS/irnas-docker-software/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/IRNAS/irnas-docker-software/compare/b08044e0137bcbbf5f060545de6b2d2a9f1ee8d8...v1.0.0
[1.0.0]:
https://github.com/IRNAS/irnas-docker-software/compare/b08044e0137bcbbf5f060545de6b2d2a9f1ee8d8...v1.0.0
12 changes: 8 additions & 4 deletions ncs-zephyr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ RUN <<EOT
rm ./yq
EOT

SHELL ["/bin/bash", "-c"]
ENTRYPOINT ["nrfutil", "toolchain-manager", "launch", "--shell"]
# Append environment variables of the toolchain-manager to the user's bashrc to
# get access to the installed programs. See extra info at the end of the file.
RUN nrfutil toolchain-manager env --as-script sh >> ~/.bashrc

#############
# Dev image #
Expand Down Expand Up @@ -161,5 +162,8 @@ RUN find /home/user/ncs/toolchains/ -path '**/usr/local/bin/*' | \
# Make 'user' default on launch
USER user

SHELL ["/bin/bash", "-c"]
ENTRYPOINT ["nrfutil", "toolchain-manager", "launch", "--shell"]
# Append environment variables of the toolchain-manager to the user's bashrc to
# get access to the installed programs.
# Previously that was done with the ENTRYPOINT command, however that is a bit
# error prone for devcontainer usecases, as it isn't always taken into account.
RUN nrfutil toolchain-manager env --as-script sh >> ~/.bashrc

0 comments on commit b10fe38

Please sign in to comment.