Skip to content

Add Docker guide to website#144

Open
blipp wants to merge 3 commits intomainfrom
blipp/docker-guide
Open

Add Docker guide to website#144
blipp wants to merge 3 commits intomainfrom
blipp/docker-guide

Conversation

@blipp
Copy link
Copy Markdown
Contributor

@blipp blipp commented May 30, 2025

No description provided.

@blipp blipp requested a review from a team as a code owner May 30, 2025 10:32
---
title: "Rosenpass inside a Docker container"
linkTitle: "Docker"
weight: 20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In my experience, it's easiest to use larger ranges. That way, there's no need to reshuffle all weights when a new page need to be inserted in between two existing ones (and lexicographical ordering isn't sufficient).

Example:

  • Arch: 50 (instead of 5)
  • Debian: 40 (instead of 4)
  • Ubuntu: 30 (instead of 3)

That's of course an insignificant detail, but I don't see any disadvantages either :)


Semi-related: The Arch and "Generic Linux" guides have the same weight (5) - copy/paste error?

menu: false
hideLead: true
type: docs
shortBlerb: "Set up and use Rosenpass with Docker"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't have a source for this guideline (except this?), but "use" is very unspecific in this context. It's not that important if the text doesn't feature prominently, but in the guides themselves I'd refine those key verbs.


{{% blocks/section color="light" class="no-flex contains-code-snippets package" %}}

This page provides you with a usage guide for running Rosenpass and WireGuard inside a Docker container, and shows how to route the host's traffic through the VPN that the container provides.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
This page provides you with a usage guide for running Rosenpass and WireGuard inside a Docker container, and shows how to route the host's traffic through the VPN that the container provides.
This guide explains how to run both Rosenpass and WireGuard from inside a Docker container. You'll also learn how to route the host's traffic through the VPN that this container provides.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might be worth specifying upfront what level of familiarity with Docker concepts is assumed. Adding something like "Docker-specific concepts will not be explained here" is perfectly acceptable as well, although I suspect someone who doesn't know the first thing about Docker wouldn't read the guide to begin with.

Naturally, if no Docker-specific knowledge is required to follow the instructions this is a moot point.

This page provides you with a usage guide for running Rosenpass and WireGuard inside a Docker container, and shows how to route the host's traffic through the VPN that the container provides.

Table of Contents:
* [WireGuard on the hosts, Rosenpass in containers](#wireguard-on-the-hosts-rosenpass-in-containers): Connect two hosts through a Rosenpass-enhanced WireGuard connection, Rosenpass running inside a container, respectively.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* [WireGuard on the hosts, Rosenpass in containers](#wireguard-on-the-hosts-rosenpass-in-containers): Connect two hosts through a Rosenpass-enhanced WireGuard connection, Rosenpass running inside a container, respectively.
* [Running WireGuard on the hosts and Rosenpass inside containers](#wireguard-on-the-hosts-rosenpass-in-containers): Connect two containerized Rosenpass instances, without restricting Wireguard itself


Table of Contents:
* [WireGuard on the hosts, Rosenpass in containers](#wireguard-on-the-hosts-rosenpass-in-containers): Connect two hosts through a Rosenpass-enhanced WireGuard connection, Rosenpass running inside a container, respectively.
* [Rosenpass and WireGuard both in containers (on the same host)](#rosenpass-and-wireguard-both-in-containers-on-the-same-host): Connect two containers through a Rosenpass-enhanced WireGuard.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* [Rosenpass and WireGuard both in containers (on the same host)](#rosenpass-and-wireguard-both-in-containers-on-the-same-host): Connect two containers through a Rosenpass-enhanced WireGuard.
* [Running both Rosenpass and WireGuard inside containers (on the same host)](#rosenpass-and-wireguard-both-in-containers-on-the-same-host): Connect two containerized Rosenpass instances.

Somewhat debatable, but the idea is to highlight the key difference (WireGuard containerized or not).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Side note: If full virtualization is expected to be the "commonly-used" option, maybe swapping them so that the common case comes first could be beneficial? (Not sure how likely WG w/o Docker is in general)


#### 1. Start by generating secret keys for both peers

**Note:** These will be stored in newly created `server.rosenpass-secret` and `client.rosenpass-secret` directories.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
**Note:** These will be stored in newly created `server.rosenpass-secret` and `client.rosenpass-secret` directories.
Rosenpass will store generated keys in newly-created `server.rosenpass-secret` and `client.rosenpass-secret` directories.

...
```

While the ping is running, you may stop the server container, and verify that the ping-log halts. In another terminal do:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
While the ping is running, you may stop the server container, and verify that the ping-log halts. In another terminal do:
While `ping` is running, you may stop the server container and confirm that the ping-log halts. To do so, type this (in another terminal):

Comment thread content/en/docs/rosenpass-tool/guides/docker.md Outdated
exchange workdir/server.rosenpass-secret dev rosenpass0 \
listen 0.0.0.0:9999 peer workdir/client.rosenpass-public allowed-ips 10.0.0.0/8
```
We note down some values we need to start the VPN client container:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
We note down some values we need to start the VPN client container:
Storing some variables needed to start the VPN client container:


{{% blocks/section color="light" class="no-flex contains-code-snippets compilation" %}}

If you want to move the containers to separate hosts, you can try Docker overlay networks and swarm.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since that isn't explicitly covered by the guide, it's not clear to me whether the intent was to explain "why" users might want to containerize WG. If that's indeed the idea, then the introduction could be rephrased to clarify that this is just one particular use case. I'd probably focus more on contrasting this scenario with the previous one, which mentions kernel access/trust (not portability) to convey what's different here.

private-key ./workdir-client/wg-client-secret \
peer $(cat ./workdir-client/wg-server-public) \
allowed-ips $CIDR_VPN \
endpoint $SERVER_IP:10000 \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
endpoint $SERVER_IP:10000 \
endpoint $SERVERIP:10000 \

outfile workdir/server-sharedkey
```

If you get the error message `… rosenpass] Cannot assign requested address (os error 99)`, try with `listen 0.0.0.0:9999`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Can't actually see this when running in detached mode)

Both peers need the `-public` directory of other peer, respectively, and it needs to be placed next to the `-secret` and `-public` directories that already exist:

Copy the server's public key to the client's working directory:
```sh{class="starter-code-client-user"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this use the $SERVERIP and $CLIENTIP variables, respectively?

Other potential improvements (if the command was intended to be copy/pasted directly):
The paths are relative and not absolute; the user name could be obtained via whoami?

Co-authored-by: Philipp Dresselmann <phildremi+github@gmail.com>
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.

2 participants