Skip to content

gum spin called when building an image fails #328

@Jonathan-Zollinger

Description

@Jonathan-Zollinger

Describe the bug
 Using gum to try and obfuscate podman's output results in an error whose message is failed to run spin: open /dev/tty: no such device or address. (Docker alternative by redhat - it's syntactically interchangeable with Docker)

To Reproduce
 Steps to reproduce the behavior:

  1. configure a Dockerfile to install gum before calling other scripts / install
  2. call gum spin in the Dockerfile to obfuscate the output of any old command

Expected behavior
gum spin would obfuscate the output of the package managers / other scripts when podman

Screenshots

gif recording

gum-usage-with-podman

Desktop (please complete the following information):

    OS Windows --ssh --> Fedora37 Host --podman--> Fedora37 container
    Terminal Fedora: Kitty
    Windows: pwsh via Windows Terminal

Additional context

 To justify what I'm trying to do, though Docker and Podman are syntactically interchangeable, Podman's output can slightly differ. Podman muddies up the console when building an image unlike 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcmd/spin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions