forked from fluent/fluent-bit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.windows
69 lines (55 loc) · 3.01 KB
/
Dockerfile.windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# escape=`
ARG WINDOWS_VERSION=ltsc2019
#
# Builder Image - Windows Server Core
#
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION as builder
# The FLUENTBIT_VERSION ARG must be after the FROM instruction
ARG FLUENTBIT_VERSION=1.3.8
ARG IMAGE_CREATE_DATE
ARG IMAGE_SOURCE_REVISION
# Metadata as defined in OCI image spec annotations
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
LABEL org.opencontainers.image.title="Fluent Bit" `
org.opencontainers.image.description="Fluent Bit is an open source and multi-platform Log Processor and Forwarder which allows you to collect data/logs from different sources, unify and send them to multiple destinations. It's fully compatible with Docker and Kubernetes environments." `
org.opencontainers.image.created=$IMAGE_CREATE_DATE `
org.opencontainers.image.version=$FLUENTBIT_VERSION `
org.opencontainers.image.authors="Eduardo Silva <[email protected]>" `
org.opencontainers.image.url="https://hub.docker.com/r/fluent/fluent-bit" `
org.opencontainers.image.documentation="https://docs.fluentbit.io/manual/" `
org.opencontainers.image.vendor="Fluent Organization" `
org.opencontainers.image.licenses="Apache-2.0" `
org.opencontainers.image.source="https://github.com/fluent/fluent-bit" `
org.opencontainers.image.revision=$IMAGE_SOURCE_REVISION
#
# Basic setup
#
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Write-Host ('Creating folders'); `
New-Item -Type Directory -Path /local; `
New-Item -Type Directory -Path /fluent-bit;
WORKDIR /local
#
# Install Fluent Bit
#
RUN Write-Host ('Installing Fluent Bit'); `
$majorminor = ([Version]::Parse("$env:FLUENTBIT_VERSION")).toString(2); `
Invoke-WebRequest -Uri "https://fluentbit.io/releases/$($majorminor)/td-agent-bit-$($env:FLUENTBIT_VERSION)-win64.zip" -OutFile td-agent-bit.zip; `
Expand-Archive -Path td-agent-bit.zip -Destination /local/fluent-bit; `
Move-Item -Path /local/fluent-bit/*/* -Destination /fluent-bit/;
#
# Technique from https://github.com/StefanScherer/dockerfiles-windows/blob/master/mongo/3.6/Dockerfile
#
ADD https://aka.ms/vs/15/release/vc_redist.x64.exe /local/vc_redist.x64.exe
RUN Write-Host ('Installing Visual C++ Redistributable Package'); `
Start-Process /local/vc_redist.x64.exe -ArgumentList '/install', '/quiet', '/norestart' -NoNewWindow -Wait; `
Copy-Item -Path /Windows/System32/msvcp140.dll -Destination /fluent-bit/bin/; `
Copy-Item -Path /Windows/System32/vccorlib140.dll -Destination /fluent-bit/bin/; `
Copy-Item -Path /Windows/System32/vcruntime140.dll -Destination /fluent-bit/bin/;
#
# Runtime Image - Windows Server Nano
#
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION as runtime
COPY --from=builder /fluent-bit /fluent-bit
RUN setx /M PATH "%PATH%;C:\fluent-bit\bin"
ENTRYPOINT ["fluent-bit.exe", "-i", "dummy", "-o", "stdout"]