0

Please keep in mind, I'm still learning Docker. I've only been at it for a few days. However, I'm trying to work with an Ubuntu:Latest Docker container. In the CMD line I have a shell script that runs some commands then an expect file.

Shell file:

#!/bin/bash
/mnt/scprime/spd /data -M gctwh &
sleep 45
expect /mnt/scprime/wallet.exp
Expect file:

#!/usr/bin/expect
set my_password mypass
spawn /mnt/scprime/spc wallet unlock
expect "Wallet password:" {send -- "$my_password\r"}
interact

I can run this script with no issues via bash within the container. But when I run it in a shell script in the CMD it crashes the container after the expect file runs. It seems to happen after the "interact" because the spc executable is interactive as it requests a password.

I've tried this and it still crashes.

#!/bin/bash
SCPRIME_WALLET_PASSWORD=mypass
export SCPRIME_WALLET_PASSWORD
/mnt/scprime/spc wallet unlock

I created a shell script and it crashes because it's interactive as well.

#!/bin/bash

apt-get -y install someapp

I'm trying to make this process as easy and possible without creating multiple images from existing containers after I install something. However, what am I doing wrong?

xTHENKx
  • 1
  • 1
  • 1
    Your question doesn’t include anything about your Docker environment. What is in the Dockerfile. How do you start your container? – AlexD Jan 14 '22 at 07:12

0 Answers0