Skip to content

chore: add timberio/vector-alpine docker image #659

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

Merged
merged 5 commits into from
Jul 18, 2019
Merged
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
3 changes: 3 additions & 0 deletions .metadata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,7 @@ configuration = "https://docs.vector.dev/usage/configuration"
crc = "https://en.wikipedia.org/wiki/Cyclic_redundancy_check"
default_configuration = "https://github.com/timberio/vector/blob/master/config/vector.toml"
docker = "https://www.docker.com/"
docker_alpine = "https://hub.docker.com/_/alpine"
dockerfile = "https://github.com/timberio/vector/blob/master/Dockerfile"
docker_hub_vector = "https://hub.docker.com/r/timberio/vector"
docs = "https://docs.vector.dev"
Expand All @@ -1272,6 +1273,7 @@ kafka = "https://kafka.apache.org/"
kafka_partitioning_docs = "https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-Partitioningandbootstrapping"
kafka_protocol = "https://kafka.apache.org/protocol"
kubernetes_limit_resources = "https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/"
leveldb = "https://github.com/google/leveldb"
lua = "https://www.lua.org/"
lua_docs = "https://www.lua.org/manual/5.3/"
lua_manual = "http://www.lua.org/manual/5.1/manual.html"
Expand All @@ -1285,6 +1287,7 @@ new_source = "https://github.com/timberio/vector/issues/new?labels=Type%3A+New+F
new_transform = "https://github.com/timberio/vector/issues/new?labels=Type%3A+New+Feature"
nginx = "https://www.nginx.com/"
prometheus = "https://prometheus.io/"
rdkafka = "https://github.com/edenhill/librdkafka"
regex = "https://en.wikipedia.org/wiki/Regular_expression"
regex_grouping_and_flags = "https://docs.rs/regex/1.1.7/regex/#grouping-and-flags"
regex_tester = "https://regex-golang.appspot.com/assets/html/index.html"
Expand Down
21 changes: 21 additions & 0 deletions distribution/docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM alpine:latest AS builder

LABEL MAINTAINER="Vector Contributors <[email protected]>"

ENV VECTOR_VERSION latest

WORKDIR /scripts

# Downloading Vector
ADD https://packages.timber.io/vector/${VECTOR_VERSION}/vector-${VECTOR_VERSION}-x86_64-unknown-linux-musl.tar.gz ./

# Installing packages
RUN mkdir vector && \
mkdir /etc/vector && \
tar -xzf vector-${VECTOR_VERSION}-x86_64-unknown-linux-musl.tar.gz --directory="vector" --strip-components=2 && \
cp -a vector/config/. /etc/vector

FROM alpine:latest

COPY --from=builder /scripts/vector/bin/* /usr/local/bin/
COPY --from=builder /etc/vector /etc
34 changes: 30 additions & 4 deletions docs/setup/installation/manual/from-archives.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ architectures. If you don't see an architecture, then we recommend

{% tabs %}
{% tab title="Latest" %}
"Latest" represents the latest stable release.
"Latest" represents the latest [released version][url.releases].

| Architecture | Channel | Notes |
| :------------| :-----: | :---- |
| [`x86_64-apple-darwin`][url.vector_latest_x86_64-apple-darwin] | `latest` | 64-bit OSX (10.7+, Lion+) |
| [`uknown-linux-gnu`][url.vector_latest_x86_64-unknown-linux-gnu] | `latest` | 64-bit Linux (2.6.18+) |
| [`uknown-linux-musl`][url.vector_latest_x86_64-unknown-linux-musl] | `latest` | 64-bit Linux with MUSL |
| ⚠️ [`uknown-linux-musl`][url.vector_latest_x86_64-unknown-linux-musl] | `latest` | 64-bit Linux with MUSL |

{% endtab %}
{% tab title="Edge" %}
"Edge" represents build off of the latest version of `master`.
"Edge" builds are continuous and built after every change merged into
the [`master` repo branch][url.vector_repo].

{% hint style="warning" %}
This release could have bugs or other issues. Please think carefully before
Expand All @@ -39,10 +40,13 @@ using them over the "latest" alternatives.
| :------------| :-----: | :---- |
| [`x86_64-apple-darwin`][url.vector_edge_x86_64-apple-darwin] | `edge` | 64-bit OSX (10.7+, Lion+) |
| [`uknown-linux-gnu`][url.vector_edge_x86_64-unknown-linux-gnu] | `edge` | 64-bit Linux (2.6.18+) |
| [`uknown-linux-musl`][url.vector_edge_x86_64-unknown-linux-musl] | `edge` | 64-bit Linux with MUSL |
| ⚠️ [`uknown-linux-musl`][url.vector_edge_x86_64-unknown-linux-musl] | `edge` | 64-bit Linux with MUSL |
{% endtab %}
{% endtabs %}

⚠️ = This release is limited, it does not support on-disk buffers or the [`kafka` sink][docs.kafka_sink]. See the [Limited Releases](#limited-releases) section for more info.


## Installation

Change into the directory you want to install Vector, such as your home dir:
Expand Down Expand Up @@ -124,6 +128,21 @@ If you plan to run Vector under a separate user, be sure that the directory
is writable by the `vector` process.
{% endhint %}

## Limited Releases

For certain release targets Vector releases limited builds. These builds lack
the following features:

1. On-disk buffers.
2. The [`kafka` sink][docs.kafka_sink].

The reason these features are not included is due to the libraries required
to power them. Specifically, we use [`leveldb`][url.leveldb] and
[`rdkafka`][url.rdkafka] to power these features. Unforutnately, compiling
and/or statically linking these libraries has proven to be a challenge. This
is something we are working to resolve. You can track progress on
[issue 546][url.issue_661].

## Service Managers

Vector archives ship with service files in case you need them:
Expand Down Expand Up @@ -152,10 +171,17 @@ Simply follow the same [installation instructions above](#installation).
[docs.configuration]: ../../../usage/configuration
[docs.data_directory]: ../../../usage/configuration/README.md#data-directory
[docs.from_source]: ../../../setup/installation/manual/from-source.md
[docs.kafka_sink]: ../../../usage/configuration/sinks/kafka.md
[docs.package_managers]: ../../../setup/installation/package-managers
[docs.platforms]: ../../../setup/installation/platforms
[url.issue_661]: https://github.com/timberio/vector/issues/661
[url.leveldb]: https://github.com/google/leveldb
[url.rdkafka]: https://github.com/edenhill/librdkafka
[url.releases]: https://github.com/timberio/vector/releases
[url.vector_edge_x86_64-apple-darwin]: https://packages.timber.io/vector/edge/vector-edge-x86_64-apple-darwin.tar.gz
[url.vector_edge_x86_64-unknown-linux-gnu]: https://packages.timber.io/vector/edge/vector-edge-x86_64-unknown-linux-gnu.tar.gz
[url.vector_edge_x86_64-unknown-linux-musl]: https://packages.timber.io/vector/edge/vector-edge-x86_64-unknown-linux-musl.tar.gz
[url.vector_latest_x86_64-apple-darwin]: https://packages.timber.io/vector/latest/vector-latest-x86_64-apple-darwin.tar.gz
[url.vector_latest_x86_64-unknown-linux-gnu]: https://packages.timber.io/vector/latest/vector-latest-x86_64-unknown-linux-gnu.tar.gz
[url.vector_latest_x86_64-unknown-linux-musl]: https://packages.timber.io/vector/latest/vector-latest-x86_64-unknown-linux-musl.tar.gz
[url.vector_repo]: https://github.com/timberio/vector
17 changes: 17 additions & 0 deletions docs/setup/installation/platforms/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ docker run -v $PWD/vector.toml:/etc/vector/vector.toml:ro timberio/vector:latest
docker run -v $PWD/vector.toml:/etc/vector/vector.toml:ro timberio/vector-slim:latest
```
{% endcode-tabs-item %}
{% code-tabs-item title="alpine" %}
{% hint style="warning" %}
This target is limited, it does not support on-disk buffers or the [`kafka` sink][docs.kafka_sink]. See the [Limited Releases][docs.from-archives.limited-releases] section for more info.
{% endhint %}

```bash
docker run -v $PWD/vector.toml:/etc/vector/vector.toml:ro timberio/vector-alpine:latest
```
{% endcode-tabs %}

Modify `$PWD` to the directory where you store your local `vector.toml` file.
Expand Down Expand Up @@ -70,6 +78,12 @@ possible is desired. To minimize image size, it's uncommon for additional
related tools (such as git or bash) to be included. Using this image as a
base, add the things you need in your own Dockerfile.

### timberio/vector-alpine:<version>

This image is based on [`alpine:latest`][url.docker_alpine] which is a Linux
distribution built around musl libc and BusyBox. It is considerably smaller in
size than other Docker images and statically links libraries.

## Versions

Timber's Docker images include a special `latest` version that will be updated
Expand All @@ -91,8 +105,11 @@ docker run timberio/vector:latest


[docs.configuration]: ../../../usage/configuration
[docs.from-archives.limited-releases]: ../../../setup/installation/manual/from-archives.md#limited-releases
[docs.kafka_sink]: ../../../usage/configuration/sinks/kafka.md
[docs.starting]: ../../../usage/administration/starting.md
[url.default_configuration]: https://github.com/timberio/vector/blob/master/config/vector.toml
[url.docker_alpine]: https://hub.docker.com/_/alpine
[url.docker_hub_vector]: https://hub.docker.com/r/timberio/vector
[url.releases]: https://github.com/timberio/vector/releases
[url.systemd]: https://www.freedesktop.org/wiki/Software/systemd/
1 change: 1 addition & 0 deletions docs/usage/administration/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ More options can be set with [flags][docs.starting.flags] when


[docs.monitoring.logs]: ../../usage/administration/monitoring.md#logs
[docs.sinks]: ../../usage/configuration/sinks
[docs.starting.flags]: ../../usage/administration/starting.md#flags
[docs.starting]: ../../usage/administration/starting.md
3 changes: 3 additions & 0 deletions scripts/release-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ set -eu

echo "Releasing timberio/vector* Docker images"
docker build -t timberio/vector:$VERSION distribution/docker
docker build -t timberio/vector-alpine:$VERSION distribution/docker/alpine
docker build -t timberio/vector-slim:$VERSION distribution/docker/slim
docker build -t timberio/vector:latest distribution/docker
docker build -t timberio/vector-slim:latest distribution/docker/slim

docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
docker push timberio/vector:$VERSION
docker push timberio/vector-alpine:$VERSION
docker push timberio/vector-slim:$VERSION
docker push timberio/vector:latest
docker push timberio/vector-alpine:latest
docker push timberio/vector-slim:latest
1 change: 1 addition & 0 deletions scripts/release-s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ aws s3 cp "target/artifacts/" "s3://packages.timber.io/vector/$VERSION/" --recur
# Update the "edge" files
echo "Uploading all artifacts to s3://packages.timber.io/vector/edge/"
td=$(mktemp -d)

cp -a "target/artifacts/." "$td"
rename -v "s/$escaped_version/edge/" $td/*
echo "Renamed all builds: via \"s/$escaped_version/edge/\""
Expand Down
11 changes: 10 additions & 1 deletion scripts/signoff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
# Signs all previous commits with a DCO signoff as described in the
# CONTRIBUTING.md document.

_current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
hash1=$(git show-ref --heads -s master)
hash2=$(git merge-base master $_current_branch)

if [ "${hash1}" != "${hash2}" ]; then
echo "You branch is not rebased with master. Please rebase first:"
echo ""
echo " git rebase master"
exit 1
fi

echo "We found the following commits since master:"
echo ""
Expand All @@ -29,7 +39,6 @@ echo ""

_signoff="sign: $(git config --get user.name) <$(git config --get user.email)>"
_commit_count=$(git rev-list --count --no-merges master..)
_current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')

git config trailer.sign.key "Signed-off-by"
git filter-branch -f --msg-filter \
Expand Down