Open JohnHind opened 7 months ago
Is the environment variable supported? I can find no documentation of environment variables here
Clear and unequivocal: no.
As you can see from the README, the values are passed as program arguments. Therefore, you must use the arguments in your Docker Compose file instead of environment variables. The key word here is command
. In your case, the file should look like this:
version: "3"
services:
wetty:
image: wettyoss/wetty:latest
container_name: wetty
extra_hosts:
- "host.docker.internal:host-gateway"
command:
- "--ssh-host"
- "host.docker.internal"
ports:
- 3002:3000
restart: unless-stopped
For example, `--ssh-user' and others can now be set in the same schema.
Many thanks Luigi, that works nicely!
May I suggest it would be VERY useful to include this Docker Compose example in the README along with the Docker command line version? The absence of this caused me to Google it resulting in many examples using the environment variables. I have realized that WeTTY has gone through 'forking hell' with numerous undocumented versions in Docker Hub (many of them seem to have been abandoned years ago) and I guess some of them have added environment variable support. It might also be useful to acknowledge this and explicitly state that environment variables are NOT supported in this root version.
As another suggestion, the wettyoss/wetty documentation in Docker Hub needs improvement. It does not actually talk about running WeTTY under Docker at all! I guess it is a copy of an earlier version of the README from here. Just updating to the current version would at least mention Docker, but combine that with the above information for Docker Compose and we'd be where we need to be.
Hm.. Spoke too soon! Damn thing worked once but since then it gives an ssh resolution error when I try to reconnect. I guess I need some SSH jujitsu as well!
Let's see what the maintainer says ;)
Do you have any more detailed error messages or a minimal example to reconstruct? I have so far only used wetty to access another container (Ubuntu) without any errors.
Thanks again Luigi, turns out this was a problem with CasaOS not supporting the 'extra_hosts' section in the Docker Compose. I first built it in Portainer and it worked fine. Then I imported it into CasaOS which ingested the Docker Compose file and used it to rebuild the container. Since the whole purpose of this exercise is to migrate away from CasaOS (WeTTY being a replacement for CasaOS's web terminal functionality, which along with 'Filebrowser', should allow me to replace the dashboard functionality of CasaOS with 'Dashy') so this does not matter. Thanks again for all your help!
This looks like very useful software, but can anyone help me with setting it up please!
What I want to achieve: I want a docker container running on a Raspberry Pi which will serve me a terminal in a remote browser onto the host operating system which is running the docker container.
What already works: I can get a remote SSH terminal (for example from VS Code) on 'pi@octosnap.local' with a known password.
What I have tried: After a lot of research and faffing about I determined that the following Docker Compose ought to work:
But when I point my remote browser at "http://octosnap.local:3002/wetty", I get the following:
Ping host.docker.internal from a terminal within the Docker container works fine. I was also able to ssh pi@host.docker.internal from within the container although it did prompt me to accept the key fingerprint, but gave the correct pi@octosnap: command prompt.
Is it trying to connect to the wrong server? What does the hex string ahead of 'login' mean? Is the environment variable supported? I can find no documentation of environment variables here, but did find several sources for this around the Internet. If not, how can I pass the host address into the Docker container? Am I missing something else?
Help!