Skip to content

add openssh-client to devcontainer #1136

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
## __WORK IN PROGRESS__
(at the beginning of a new line)
-->

## __WORK IN PROGRESS__
* (hacki11) Support git-ssh in devcontainer (#1136) [Migration guide](docs/updates/20250401_devcontainer_ssh.md)

## 2.6.5 (2024-09-13)
* (AlCalzone) Update required versions of `js-controller` and `admin` to the current stable versions (#1116)
* (AlCalzone) Remove deprecated `main` and `title` fields from `io-package.json` (#1115)
Expand Down
13 changes: 13 additions & 0 deletions docs/updates/20250401_devcontainer_ssh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Add git-ssh support in DevContainer

To be able to push to git using ssh url in a DevContainer, ssh is needed in the docker image.

Make sure to add this change to `.devcontainer/iobroker/Dockerfile`:

```diff
FROM iobroker/iobroker:latest
RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules
+# Needed to use git-ssh in devcontainer
+RUN apt-get update \
+ && apt-get -y --no-install-recommends install openssh-client
```
3 changes: 3 additions & 0 deletions templates/_devcontainer/iobroker/_Dockerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const templateFunction: TemplateFunction = answers => {
const template = `
FROM iobroker/iobroker:latest
RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules
# Needed to use git-ssh in devcontainer
RUN apt-get update \\
&& apt-get -y --no-install-recommends install openssh-client
`;
return template.trim();
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
FROM iobroker/iobroker:latest
RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules
RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules
# Needed to use git-ssh in devcontainer
RUN apt-get update \
&& apt-get -y --no-install-recommends install openssh-client