[英]bash: line : docker: command not found
我在 docker 容器中使用 jenkins 並且想啟動另一個實例,每當我嘗試使用 docker 命令時
docker run -t -i ap/dashboard /bin/bash
我收到此錯誤:
bash: line 61: docker: command not found
如何導航到另一個容器或解決此錯誤?
通過閱讀/root/.ash_history
,我可以清楚地看到虛擬機創建者能夠使用 docker 命令
以下是有關該系統的一些詳細信息:
[-] Specific release information:
3.3.1
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.3.1
PRETTY_NAME="Alpine Linux v3.3"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"
Hostname:
b51cdbb7eebd
ENVIRONMENTAL #######################################環境信息:JENKINS_VOL=/var/lib/詹金斯 JAVA_VERSION_BUILD=17 HOSTNAME=b51cdbb7eebd JAVA_VERSION_MAJOR=8 JENKINS_HOME=/opt/jenkins NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat PATH=/usr/local/sbin:/usr/local/ bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/java/jre/bin JAVA_BASE=/usr/local/java PWD=/ JAVA_HOME=/usr/local/java/jre JAVA_PKG =server-jre LANG=C.UTF-8 XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt SHLVL=2 HOME=/root PKG_URL=https://circle-artifacts.com/gh/andyshinn/alpine-pkg -glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64 JENKINS_VERSION=1.637 JAVA_VERSION_MINOR=66 _=/usr/bin/env
[-] Available shells:
# valid login shells
/bin/sh
/bin/ash
/bin/bash
[+] We can read root's home directory!
total 76
drwx------ 5 root root 4.0K Aug 28 2018 .
drwxr-xr-x 1 root root 4.0K Nov 24 10:55 ..
-rw------- 1 root root 3.1K Aug 29 2018 .ash_history
-rw------- 1 root root 155 May 16 2016 .bash_history
drwxr-xr-x 2 root root 4.0K May 12 2016 .oracle_jre_usage
drwx------ 2 root root 4.0K Aug 28 2018 .ssh
-rwxr-xr-x 1 root root 46.0K Aug 28 2018 LinEnum.sh
drwxr-xr-x 3 root root 4.0K May 12 2016 dockerfiles
-rw-r--r-- 1 root root 0 Aug 28 2018 foo
Looks like we're in a Docker container: 10.net_prio:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 9.net_cls:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 8:freezer:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 7:devices:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 6:memory:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 5:blkio:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 4:cpuacct:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 3:cpu:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 2:cpuset:/docker/b51cdbb7eebd806431ee4120d9b3ae050dbefe4a835bf2063446724572e45e30 1:name=openrc:/docker -rwxr-xr-x 1 root root 0 2016 年 5 月 16 日 /.dockerenv
[-] Anything juicy in the Dockerfile:
-rw-r--r-- 1 root root 617 May 12 2016 /root/dockerfiles/jenkins/Dockerfile
我毫無希望地嘗試了許多 docker 命令
是因為我已經在容器里了嗎??
嘗試使用docker run -t -i ap/dashboard /bin/ash
。
也許你的容器不使用bash
所以你應該嘗試使用/bin/sh
這是默認安裝的 shell 處理器的符號鏈接。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.