![](/img/trans.png)
[英]Docker unable to start an interactive shell if the image has an entry script
[英]Shell script to push docker image to docker hub is stuck
I'm trying to push the docker image using the shell script, works fine till login it gets logged in but at push
command it gets stuck, when I run docker push
command manually it pushes the image but not using shell script.
#!/bin/bash
set -x #echo on
variableA=$(docker build -f test.dockerfile --network=host --no-cache -t myrepo/docker-test . | tail -n1 | cut -d " " -f3)
echo "$variableA"
docker ps -a
echo "$DOCKER_HUB_PWD" | docker login --username="$DOCKER_HUB_UNAME" --password-stdin
tail -n1
docker push myrepo/docker-test:latest
tail -n1
它是由tail -n1
引起的。
tail 命令查找輸入文件或數據 stream。
句法:
$ tail [OPTION]... [FILE]...
例子:
$ tail -n1 FILE.TXT
cat FILE.TXT | tail -n1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.