https://github.com/zw963/docker_wget_nopain
Create a wget function in docker, and use it download static compile wget.
https://github.com/zw963/docker_wget_nopain
Last synced: 6 months ago
JSON representation
Create a wget function in docker, and use it download static compile wget.
- Host: GitHub
- URL: https://github.com/zw963/docker_wget_nopain
- Owner: zw963
- Created: 2017-05-19T07:58:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-19T08:15:06.000Z (about 9 years ago)
- Last Synced: 2025-04-05T14:11:56.176Z (over 1 year ago)
- Size: 0 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker_wget_nopain
Create a wget function in docker, and use it download static compile wget.
Does you use Dockerfile like this:
```Dockerfile
# install wget
RUN apt-get update && apt-get install -qq -y --no-install-recommends wget && rm -rf /var/lib/apt/lists/*
#####################
# do whatever tasks which need wget to download somethings ..
######################
# remove wget
RUN apt-get purge -y --auto-remove wget
```
This is not the correct way to do this.
If run `docker history your_image``, you will see
```sh
...
41753cb4a6be 4 hours ago /bin/sh -c apt-get purge -y --auto-remove ... 445 kB
1eae68198132 17 hours ago /bin/sh -c apt-get update && apt-get insta... 34.4 MB
...
```
Because you `install wget` and `remove wget` in seperate step, you got about `34MB` unuseful data
into docker layout.
Another way to do this is, in every step you need wget, write as followings
```dockerfile
RUN apt-get update && apt-get install -qq -y --no-install-recommends wget && rm -rf /var/lib/apt/lists/* && \
do-what-ever-process-need-wget && \
RUN apt-get purge -y --auto-remove wget
```
This method exist too much redundant code to process wget, not perfect.
## Why use bash to download a static compiled wget, and just use it?
This project is the attempt to do this.