charmbracelet / wishlist

The SSH directory ✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running in docker: Error: open /dev/tty: no such device or address

ikidd opened this issue · comments

I've used the example docker command and built a docker-compose for wishlist and get this in docker logs when starting it up:

2022/02/28 22:23:31 Using config from .wishlist/config.yaml
Error: open /dev/tty: no such device or address

docker-compose.yml:

version: "3.1"
services:
  wishlist:
    container_name: wishlist
    image: charmcli/wishlist:latest
    ports: 
      - "2022:22"
    volumes:
      - .:/.wishlist

config.yaml:

listen: 0.0.0.0
port: 22

endpoints:
-
  name: pve1
  address: 10.10.251.20:22
  user: root
  remote_command:
  forward_agent: false # forwards the ssh agent
  request_tty: true

users:
  -
    name: ikidd
    public-keys:
    - ssh-rsa AAAAB3N...>

Not sure what I'm doing wrong here.

I think you'll need to pass tty: true in your docker-compose.yml wishlist service... can you try that out?

did you managed to make it work @ikidd ?

closing due to lack of activity, feel free to ping/reopen if needed

Heya @caarlos0 , I'm running into this issue as well, but I'm using simple Docker (podman, actually - but syntactically interchangeable).

if I'm understanding correctly, I dont see a way to employ a tty tag when building an image like i'm looking to do. podman muddies up the console unline docker (which limits the output). I'm wanting to obfuscate the stdout of the install process by calling gum spin while piping the output from the install process to a log file.

this is the error that podman spits out :

STEP 6/11: RUN gum spin --spinner dot --title 'installing eDir dependencies' -- yum install -y git wget curl unzip yum-utils
failed to run spin: open /dev/tty: no such device or address
Error: building at STEP "RUN gum spin --spinner dot --title 'installing eDir dependencies' -- yum install -y git wget curl unzip yum-utils": while running runtime: exit status 1

this is my Dockerfile, for what it's worth

FROM fedora:37
WORKDIR /root
ADD . .

RUN ./install-charm.sh
RUN yum update -y
RUN gum spin --spinner dot --title 'installing eDir dependencies' -- yum install -y git wget curl unzip yum-utils
RUN gum spin --spinner line --title 'installing helpful resources' -- dnf copr enable atim/starship -y; dnf install starship -y

RUN cat ./aliases >> .bashrc; echo 'eval "$(starship init bash)"' >> .bashrc; rm ./aliases -f
ADD https://github.com/Jonathan-Zollinger/kickstart.nvim .config/nvim
RUN gum spin --spinner jump --title 'installing and configuring nvim' -- ./installnvim.sh && rm ./installnvim.sh -f;

CMD ["/bin/bash"]

the install-charm.sh script just installs glow and gum after adding the yum repo.

#!/bin/bash
# Adds charm's repo to /etc/yum.repos.d/ and installs glow & gum

echo '[charm]
name=Charm
baseurl=https://repo.charm.sh/yum/
enabled=1
gpgcheck=1
gpgkey=https://repo.charm.sh/yum/gpg.key' > /etc/yum.repos.d/charm.repo
yum install glow gum -y

I think it would add some great value by being able to enable gum here, but I can just remove the calls to gum spin and continue complaining about podman's output lol.

I've been reading into some work arounds, I'll let you know if I find anything that works

edit: I'm running on a Fedora 37 vm

I'm a doof - I thought this was the gum repo - I'll pose this question over in the gum repo.