|
| 1 | +FROM mcr.microsoft.com/windows/servercore:ltsc2019 |
| 2 | + |
| 3 | +LABEL maintainer= "Splunk Inc. <[email protected]>" |
| 4 | + |
| 5 | +# skip runtime bundler installation |
| 6 | +ENV FLUENTD_DISABLE_BUNDLER_INJECTION 1 |
| 7 | +COPY *.gem /tmp/ |
| 8 | + |
| 9 | +RUN powershell -Command \ |
| 10 | + Set-ExecutionPolicy Bypass -Scope Process -Force; \ |
| 11 | + iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) |
| 12 | + |
| 13 | +RUN choco install -y ruby --version 2.4.2.2 --params "'/InstallDir:C:\'" \ |
| 14 | + && choco install -y msys2 --params "'/NoPath /NoUpdate /InstallDir:C:\ruby24\msys64'" \ |
| 15 | + && refreshenv \ |
| 16 | + && ridk install 2 3 |
| 17 | + |
| 18 | +RUN echo gem: --no-document >> C:\ProgramData\gemrc \ |
| 19 | + && gem install -N fluentd -v "1.4.0" \ |
| 20 | + && gem install -N fluent-plugin-windows-eventlog -v "0.3.0" \ |
| 21 | + && gem install -N fluent-plugin-concat -v "2.2.2" \ |
| 22 | + && gem install -N fluent-plugin-prometheus -v "1.3.0" \ |
| 23 | + && gem install -N oj -v "3.5.1" \ |
| 24 | + && gem install -N /tmp/*.gem \ |
| 25 | + && gem sources --clear-all \ |
| 26 | + && mkdir C:\fluentd\etc |
| 27 | + |
| 28 | +# plugin hardfails when using net-http-persistent 3.0.1 on windows |
| 29 | +# https://github.com/drbrain/net-http-persistent/issues/79#issuecomment-347541046 |
| 30 | +# make an inline replacement to net-http-persistent to resolve |
| 31 | +RUN powershell -Command " \ |
| 32 | +$file = 'C:\ruby24\lib\ruby\gems\2.4.0\gems\net-http-persistent-3.0.1\lib\net\http\persistent.rb'; \ |
| 33 | +$content = (Get-Content -Path $file).Replace(\" DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4\", \" if Gem.win_platform? then`n DEFAULT_POOL_SIZE = 256`n else`n DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4`n end\"); \ |
| 34 | +Set-Content -Path $file $content;" |
| 35 | + |
| 36 | +# Remove gem cache |
| 37 | +RUN powershell -Command del C:\ruby24\lib\ruby\gems\2.4.0\cache\*.gem; |
| 38 | + |
| 39 | +ENTRYPOINT ["cmd", "/k", "fluentd"] |
| 40 | +CMD ["-h"] |
0 commit comments