用wget命令在本地创建一个网站的镜像

wget --mirror -w 2 -p --html-extension --convert-links -P site http://www.example.com

 

 

--mirror:  Specifies to mirror the site.  Wget will recursively follow all links on the site and download all necessary files.  It will also only get files that have changed since the last mirror, which is handy in that it saves download time.

-w: Tells wget to “wait” or pause between requests, in this case for 2 seconds.  This is not necessary, but is the considerate thing to do.  It reduces the frequency of requests to the server, thus keeping the load down.  If you are in a hurry to get the mirror done, you may eliminate this option.

-p: Causes wget to get all required elements for the page to load correctly.  Apparently, the mirror option does not always guarantee that all images and peripheral files will be downloaded, so I add this for good measure.

--HTML-extension:  All files with a non-HTML extension will be converted to have an HTML extension.  This will convert any CGI, ASP or PHP generated files to HTML extensions for consistency.

--convert-links:  All links are converted so they will work when you browse locally.  Otherwise, relative (or absolute) links would not necessarily load the right pages, and style sheets could break as well.

-P (prefix folder): The resulting tree will be placed in this folder.  This is handy for keeping different copies of the same site, or keeping a “browsable” copy separate from a mirrored copy.

转自:http://www.cnblogs.com/xiazh/archive/2012/06/08/2542192.html

转载于:https://www.cnblogs.com/ishaopli/articles/3886531.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以按照以下步骤构建本地JDK镜像并基于该镜像构建BWS镜像: 1. 在本地下载JDK安装包,例如 `jdk-8u291-linux-x64.tar.gz`。 2. 在本地创建一个目录,例如 `~/docker/jdk/`。 3. 将JDK安装包移动到该目录下。 4. 在该目录下创建一个 `Dockerfile` 文件,内容如下: ``` FROM ubuntu:latest # 安装必要的软件包 RUN apt-get update && \ apt-get install -y wget && \ apt-get install -y tar && \ apt-get install -y gzip && \ apt-get install -y ca-certificates && \ apt-get install -y --no-install-recommends openjdk-8-jdk && \ apt-get clean # 将JDK安装包复制到容器中 COPY jdk-8u291-linux-x64.tar.gz /opt/ # 解压JDK安装包并删除 RUN tar -xzf /opt/jdk-8u291-linux-x64.tar.gz -C /opt/ && \ rm /opt/jdk-8u291-linux-x64.tar.gz # 设置环境变量 ENV JAVA_HOME /opt/jdk1.8.0_291 ENV PATH $JAVA_HOME/bin:$PATH ``` 5. 在该目录下运行以下命令构建本地JDK镜像: ``` docker build -t myjdk:latest . ``` 6. 在BWS项目根目录下创建一个 `Dockerfile` 文件,内容如下: ``` FROM myjdk:latest # 将BWS发布包复制到容器中 COPY bws-1.0.0.tar.gz /opt/ # 解压BWS发布包并删除 RUN tar -xzf /opt/bws-1.0.0.tar.gz -C /opt/ && \ rm /opt/bws-1.0.0.tar.gz # 设置环境变量 ENV BWS_HOME /opt/bws-1.0.0 ENV PATH $BWS_HOME/bin:$PATH # 启动BWS CMD ["sh", "-c", "cd $BWS_HOME/bin && ./startup.sh && tail -f $BWS_HOME/logs/catalina.out"] ``` 7. 在BWS项目根目录下运行以下命令构建BWS镜像: ``` docker build -t mybws:latest . ``` 这样就可以构建出基于本地JDK镜像的BWS镜像了。在运行BWS容器时,只需要使用 `mybws:latest` 镜像即可。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值