当我在New Empty Docker容器中执行时,我有一个.sh脚本给出了以下错误。我无法找到问题究竟在哪里。
我的目标是使用sh脚本连接在Empty容器中安装Jenkins。
jenkins.sh脚本
# Install Java:
yum -y install java
# Verify java install:
java -version
# Download Jenkins from the Red Hat repo:
yum install wget
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
# Import the verification key using the package manager RPM:
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
# Install Jenkins by running:
yum -y install jenkins
# Input Y
#Add Jenkins to system boot
chkconfig jenkins on
# Start Jenkins as a service:
service jenkins start
# TODO: Add IP address of server:
netstat -tnlp | grep 8080
# Open browser to http://138.68.1.138:8080
错误消息 -
[root@b07136d674f7 tmp]# ./jenkins.sh
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.solarvps.com
* extras: centos.mirror.constant.com
* updates: mirror.net.cen.ct.gov
available.java
Error: Nothing to do
./jenkins.sh: line 4: java: command not found
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.solarvps.com
* extras: centos.mirror.constant.com
* updates: mirror.net.cen.ct.gov
available.wget
Error: Nothing to do
--2016-12-21 06:29:17-- http://pkg.jenkins-ci.org/redhat/jenkins.repo%0D
Resolving pkg.jenkins-ci.org... 52.202.51.185
Connecting to pkg.jenkins-ci.org|52.202.51.185|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2016-12-21 06:29:17 ERROR 404: Not Found.
curl: (3) Illegal characters found in URL
: import read failed(2).i.org/redhat/jenkins-ci.org.key
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.solarvps.com
* extras: centos.mirror.constant.com
* updates: mirror.net.cen.ct.gov
available.jenkins
Error: Nothing to do
chkconfig version 1.3.49.5 - Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.
usage: chkconfig [--list] [--type <type>] [name]
chkconfig --add <name>
chkconfig --del <name>
chkconfig --override <name>
chkconfig [--level <levels>] [--type <type>] <name> <on|off|reset|resetpriorities>
./jenkins.sh: line 16: service: command not found