我有一个expect脚本,我想在docker容器中运行。我已经将该文件命名为exp扩展名,并将该文件命名为filename.exp。我使用的是Ubuntu docker镜像。看起来容器能够识别以#!/usr/bin/env bash而不是#!/usr/bin/expect开头的文件
pipeline.yml文件
jobs:
- name: job-pass-files
public: true
plan:
- get: resource-tutorial
- task: create-some-files
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ubuntu}
inputs:
- name: resource-tutorial
run:
path: resource-tutorial/filename.expfilename.exp
#!/usr/bin/expect
eval spawn ssh -oStrictHostKeyChecking=no -oCheckHostIP=no user@****
#use correct prompt
set prompt ":|#|\\\$"
interact -o -nobuffer -re $prompt return
send "Password\r"
interact当我在大厅中执行作业时,我得到以下错误
Backend error: Exit status: 500, message: {"Type":"","Message":"runc exec: exit status 1: exec failed: container_linux.go:348: starting container process caused \"no such file or directory\"\n","Handle":"","ProcessID":"","Binary":""}有没有办法从Docker容器中执行expect脚本?有没有支持这一点的镜像?我是码头新手,所以非常感谢您的帮助。
发布于 2019-09-13 22:45:08
我使用expect脚本在我的一个16.04 Ubuntu容器中安装了一个需要用户提示的程序。请确保安装expect二进制文件,它没有包含在内。它看起来是这样的:
Dockerfile:
<snip>
#Install yocto dependencies
RUN apt-get update && apt-get -y install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
xterm repo expect locales
# Install
RUN /home/docker/scripts/install.exp
<snip>install.exp:
#!/usr/bin/expect
set timeout -1
<snip>https://stackoverflow.com/questions/57924874
复制相似问题