Docker-CentOS:如何使用wget将登录凭据传递给oracle以下载java存档?

时间:2017-09-14 05:08:43

标签: java linux docker centos docker-compose

我正在尝试从我的Dockerfile

在centos中安装oracle jdk7

代码是

RUN (wget --no-cookies --progress=dot --no-check-certificate -O /tmp/jdk-7u80-linux-x64.tar.gz --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz)

运行docker build

时出错
--2017-09-14 05:00:10--  http://download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 202.88.226.9, 202.88.226.16
Connecting to download.oracle.com (download.oracle.com)|202.88.226.9|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/akam/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz [following]
--2017-09-14 05:00:10--  
https://edelivery.oracle.com/akam/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.202.180.251, 2600:140f:b:184::2d3e, 2600:140f:b:186::2d3e, ...
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.202.180.251|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://login.oracle.com:443/oam/server/osso_login?
Site2pstoreToken=v1.2~370805C146117E1A86~3C2DBAA2C8C58FE313CFAC1694B828FCDFB2D1ED359E1FC97A97AFFB36E0521ABE7479DA34E0B6CDF350B3D68024A74BBB059D42E163B9A47B22E6CA08118B346840F9A85D8B19E85BA39B79981F5C8FFEFF65F3140CA15EDC8812CA588169C670EC6346DB7E4132E1774B49D9B31FE6BA47EB3B2F6C0AC923EB748470AC204B4BFC7AA318FF752BBCBD9C0EE6003AC4D4FFEF12C94AEA3D5B0878E43618F606885657420B5AA8390513440E64C7C19D7EBC2C12E361683F4D36A6E9F7BB818CC99B0AE725EE77588E409605F6264E77E35979733D7000C6D9A1F00377AC4EDDD5B07ABC8E608B3A577F50E915F42B2850D527701E3AA621 [following]
--2017-09-14 05:00:12--  https://login.oracle.com/oam/server/osso_login?
Site2pstoreToken=v1.2~370805C146117E1A86~3C2DBAA2C8C58FE313CFAC1694B828FCDFB2D1ED359E1FC97A97AFFB36E0521ABE7479DA34E0B6CDF350B3D68024A74BBB059D42E163B9A47B22E6CA08118B346840F9A85D8B19E85BA39B79981F5C8FFEFF65F3140CA15EDC8812CA588169C670EC6346DB7E4132E1774B49D9B31FE6BA47EB3B2F6C0AC923EB748470AC204B4BFC7AA318FF752BBCBD9C0EE6003AC4D4FFEF12C94AEA3D5B0878E43618F606885657420B5AA8390513440E64C7C19D7EBC2C12E361683F4D36A6E9F7BB818CC99B0AE725EE77588E409605F6264E77E35979733D7000C6D9A1F00377AC4EDDD5B07ABC8E608B3A577F50E915F42B2850D527701E3AA621
Resolving login.oracle.com (login.oracle.com)... 209.17.4.8
Connecting to login.oracle.com (login.oracle.com)|209.17.4.8|:443... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

我们必须从网站上手动登录oracle登录jdk7。使用wget时如何登录?

编辑:我尝试了像-c --no-check-certificate --header“Cookie:oraclelicense = accept-securebackup-cookie”这样的选项,如某些博客和主题中所给出的那样,但它是针对JDK8,而不是JDK 7

0 个答案:

没有答案