官术网_书友最值得收藏!

  • Deployment with Docker
  • Srdjan Grubor
  • 130字
  • 2021-07-02 23:22:14

Adding files from the internet

What about trying to add files to your container that are not hosted locally and/or due to licensing you cannot include them in your repository where the Dockerfile lives? For this specific purpose, there is the ADD directive. This command downloads the file from the URI provided and puts it in the container. If the file is local compressed archive, such as a .tgz or a .zip file and the target path ends with a slash, it will get expanded into that directory, making this a very useful option as opposed to COPY. In the example that we're writing here, we will take a semi-random file from GitHub and put it in the directory to be included with the following:

ADD https://raw.githubusercontent.com/moby/moby/master/README.md \
$SRV_PATH/
主站蜘蛛池模板: 监利县| 闽侯县| 凤台县| 凤阳县| 嘉义县| 邵东县| 黄大仙区| 金华市| 定日县| 东辽县| 邹平县| 凤凰县| 松潘县| 台中市| 沿河| 巴林左旗| 南漳县| 茂名市| 商城县| 防城港市| 澄江县| 浪卡子县| 龙陵县| 泸溪县| 广宗县| 盐津县| 北票市| 宜昌市| 嘉义市| 图们市| 肥西县| 鹤庆县| 灌云县| 永昌县| 株洲县| 汾阳市| 武穴市| 西安市| 门源| 汝阳县| 印江|