Files
docker-alpine/docs/usage.adoc
T
Chloe Kudryavtsev b84e5f8fad docs: Use github syntax tag for docker
Fortunately, it seems like rouge should support it as an alias.
2019-05-04 06:28:29 -04:00

46 lines
1.5 KiB
Plaintext

= Usage
== Packages
Replacing your current base image with the Docker Alpine Linux image usually requires updating the package names to the corresponding ones in the https://pkgs.alpinelinux.org[Alpine Linux package index].
We use the `apk` command to manage packages.
It works similarly to `apt` and `yum`.
For example, installing the `nginx` package would be done by running `apk add --no-cache nginx`.
The `--no-cache` argument prevents `apk` from caching the package index - something that would normally take up precious space, as well as go stale quickly.
=== Example
This is an example of a complete Dockerfile for `nginx`:
[source, dockerfile]
----
FROM alpine
RUN apk --no-cache add nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
----
=== Virtual Packages
Another great `apk` feature is the concept of user-defined virtual packages.