Browse Source

add fluent

master
zeus 3 years ago
parent
commit
335b3096fe
  1. 63
      Dockerfile
  2. 5
      Dockerfile.build
  3. 1
      README.md
  4. 3
      extrapackages
  5. 2
      repositories
  6. 59
      setup.sh

63
Dockerfile

@ -0,0 +1,63 @@
#ARG NODE_VERSION=6.17.1
#FROM mhart/alpine-node:${NODE_VERSION}
FROM fluent/fluentd:v1.11-1
LABEL \
org.opencontainers.image.title="Docker Image of fluent4poc" \
org.opencontainers.image.authors="Swarmlab.io <rootapostolos@swarmlab.io>"
#ENV PATH=/usr/local/texlive/bin/x86_64-linuxmusl:/usr/local/texlive/2020/bin/x86_64-linuxmusl:${PATH}
ENV dockeruser fluent
ENV USERhome=${dockeruser}
ENV UID=12345
ENV GID=23456
#RUN addgroup -S node \
# && adduser -D -g "" -h "/home/${USERhome}" -G "${USERhome}" -u "${UID}" "${USERhome}"
COPY \
setup.sh \
extrapackages \
repositories \
/root/
# -------- next line is in setup.sh ------
# ----------edit if not alpine ----------
# copy repositories /etc/apk/repositories
# --------------------------------------
RUN /root/setup.sh
# --- fluent ----- uncomment --------------------------
ARG USER1=fluent
ARG NODEPROJECT1src=poc-datacollector/WriteToMongo/fluent/
ARG NODEPROJECT1=fluent
ENV USER1 ${USER1}
ENV NODEPROJECTSRC ${NODEPROJECT1src}
ENV NODEPROJECT ${NODEPROJECT1}
COPY ${NODEPROJECTSRC} /home/${USER1}/${NODEPROJECT}
RUN chown -R ${USER1}.${USER1} /home/${USER1}
RUN /home/${USER1}/${NODEPROJECT}/install-fluent.sh
USER ${USER1}
WORKDIR /home/${USER1}
USER root
USER ${USER1}
WORKDIR /home/${dockeruser}
VOLUME ["/home/${dockeruser}"]
#EXPOSE 8080
CMD ["tail","-f","/dev/null"]
#CMD ["/home/node/playground-client/start-server.sh"]

5
Dockerfile.build

@ -0,0 +1,5 @@
git clone https://git.swarmlab.io:3000/swarmlab/poc-datacollector.git
docker build -f Dockerfile -t hub.swarmlab.io:5443/poc-datacollector-fluent .

1
README.md

@ -1,2 +1 @@
# playground-poc-fluent

3
extrapackages

@ -0,0 +1,3 @@
curl
build-base
ruby-dev

2
repositories

@ -0,0 +1,2 @@
http://dl-cdn.alpinelinux.org/alpine/v3.2/main @community http://dl-cdn.alpinelinux.org/alpine/edge/community

59
setup.sh

@ -0,0 +1,59 @@
#!/bin/sh
set -e
set -o pipefail
scheme="$1"
retry() {
retries=$1
shift
count=0
until "$@"; do
exit=$?
wait="$(echo "2^$count" | bc)"
count="$(echo "$count + 1" | bc)"
if [ "$count" -lt "$retries" ]; then
echo "Retry $count/$retries exited $exit, retrying in $wait seconds..."
sleep "$wait"
else
echo "Retry $count/$retries exited $exit, no more retries left."
return "$exit"
fi
done
}
# --------custom repos -------
# alpine edit 4 ubuntu
#cp /root/repositories /etc/apk/repositories
echo "==> Install system packages"
apk --no-cache add \
bash \
gnupg \
tar \
wget \
make \
xz
extrap=/root/extrapackages
if [ -f $extrap ]; then
while read -r line; do
extrapackages="$extrapackages $line"
done < $extrap
apk --no-cache add $extrapackages
else
echo "No extrapackages file"
fi
#echo "==> Install pm2"
echo "==> Clean up"
rm -rf \
/root/.gnupg \
/setup.sh \
/extrapackages
Loading…
Cancel
Save