Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a deprecation warning when using the apk-install wrapper #269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions builder/scripts/apk-install
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
#!/bin/sh

os_version = `cat /etc/os-release | grep VERSION_ID | cut -d= -f2`
version () { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }

if [ $(version $os_version) -ge $(version "3.3.0") ]; then
echo "WARNING: this script is deprecated and would be removed in future version."
echo "If your alpine version is >= 3.3 Prefer the new way of doing it, and use --no-cache option"
fi
apk add --update "$@" && rm -rf /var/cache/apk/*
6 changes: 3 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ CMD ["nginx", "-g", "daemon off;"]

This avoids the need to use `--update` and remove `/var/cache/apk/*` when done installing packages.

## Convenience Cleanup
## Convenience Cleanup (For alpine <3.3)

The `gliderlabs` variant of this image contains a small unofficial wrapper script that assists in the cleanup of the package index after installing packages. A great minimalist cleans up after ones self. Thus, the `apk-install` script was born. Here is another simple `Dockerfile` that installs the `nginx` package and removes package index data:
The `gliderlabs` variant of this image contains a small unofficial wrapper script that assists in the cleanup of the package index after installing packages if you use alpine <3.3. A great minimalist cleans up after ones self. Thus, the `apk-install` script was born. Here is another simple `Dockerfile` that installs the `nginx` package and removes package index data:

```
FROM gliderlabs/alpine:3.3
FROM gliderlabs/alpine:3.2

RUN apk-install nginx

Expand Down