mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Base Fluentd image off debian:stretch-slim for systemd with LZ4
This commit is contained in:
@@ -19,8 +19,10 @@
|
||||
# Note that fluentd is run with root permssion to allow access to
|
||||
# log files with root only access under /var/log/containers/*
|
||||
|
||||
FROM gcr.io/google-containers/debian-base-amd64:0.1
|
||||
FROM debian:stretch-slim
|
||||
|
||||
COPY clean-apt /usr/bin
|
||||
COPY clean-install /usr/bin
|
||||
COPY Gemfile /Gemfile
|
||||
|
||||
# 1. Install & configure dependencies.
|
||||
@@ -31,18 +33,13 @@ RUN BUILD_DEPS="make gcc g++ libc6-dev ruby-dev" \
|
||||
&& clean-install $BUILD_DEPS \
|
||||
ca-certificates \
|
||||
libjemalloc1 \
|
||||
liblz4-1 \
|
||||
ruby \
|
||||
&& echo 'gem: --no-document' >> /etc/gemrc \
|
||||
&& gem install --file Gemfile \
|
||||
&& apt-get purge -y --auto-remove \
|
||||
-o APT::AutoRemove::RecommendsImportant=false \
|
||||
$BUILD_DEPS \
|
||||
&& rm -rf /tmp/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/usr/lib/ruby/gems/*/cache/*.gem \
|
||||
/var/log/* \
|
||||
/var/tmp/* \
|
||||
&& clean-apt \
|
||||
# Ensure fluent has enough file descriptors
|
||||
&& ulimit -n 65536
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
PREFIX = gcr.io/google-containers
|
||||
IMAGE = fluentd-elasticsearch
|
||||
TAG = v2.0.0
|
||||
TAG = v2.0.1
|
||||
|
||||
build:
|
||||
docker build --pull -t $(PREFIX)/$(IMAGE):$(TAG) .
|
||||
|
||||
29
cluster/addons/fluentd-elasticsearch/fluentd-es-image/clean-apt
Executable file
29
cluster/addons/fluentd-elasticsearch/fluentd-es-image/clean-apt
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright 2017 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# A script encapsulating a common Dockerimage pattern for installing packages
|
||||
# and then cleaning up the unnecessary install artifacts.
|
||||
# e.g. clean-install iptables ebtables conntrack
|
||||
|
||||
set -o errexit
|
||||
|
||||
apt-get clean -y
|
||||
rm -rf \
|
||||
/var/cache/debconf/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/log/* \
|
||||
/tmp/* \
|
||||
/var/tmp/*
|
||||
30
cluster/addons/fluentd-elasticsearch/fluentd-es-image/clean-install
Executable file
30
cluster/addons/fluentd-elasticsearch/fluentd-es-image/clean-install
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright 2017 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# A script encapsulating a common Dockerimage pattern for installing packages
|
||||
# and then cleaning up the unnecessary install artifacts.
|
||||
# e.g. clean-install iptables ebtables conntrack
|
||||
|
||||
set -o errexit
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
echo >&2 "No packages specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends $@
|
||||
clean-apt
|
||||
@@ -20,10 +20,4 @@
|
||||
# For systems without journald
|
||||
mkdir -p /var/log/journal
|
||||
|
||||
# Copy host libsystemd into image to avoid compatibility issues.
|
||||
if [ ! -z "$(ls /host/lib/libsystemd* 2>/dev/null)" ]; then
|
||||
rm /lib/x86_64-linux-gnu/libsystemd*
|
||||
cp -a /host/lib/libsystemd* /lib/x86_64-linux-gnu/
|
||||
fi
|
||||
|
||||
/usr/local/bin/fluentd $@
|
||||
|
||||
Reference in New Issue
Block a user