LoginSignup
0
1

More than 5 years have passed since last update.

Jekyll と .NET Core 入りの Docker イメージを作る

Posted at

Jekyll の Docker イメージは

のように alpine Linux がベースなので、 .NET Core の alpine系の Docker イメージを探してきて、それをマネる。

するとこんな感じになりました。

Dockerfile

FROM jekyll/jekyll:3.8.4

# Install .NET Core
ENV DOTNET_VERSION 2.2.1

RUN wget -O dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSIO
N-linux-musl-x64.tar.gz \
    && dotnet_sha512='f76f8650aae126b2cdf55cce200d6400137288f5c0688e314575273ab9f87f364d06dcf0992524d8d6a127485ec11f8f6e9586a5
b47604bf1f6396748b3e7fca' \
    && echo "$dotnet_sha512  dotnet.tar.gz" | sha512sum -c - \
    && mkdir -p /usr/share/dotnet \
    && tar -C /usr/share/dotnet -xzf dotnet.tar.gz \
    && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
    && rm dotnet.tar.gz

netcore_jekyll という名前の Docker イメージを作成する。

 docker build -t netcore_jekyll .

Docker コンテナを作成&実行して Bash に入る

docker run -it netcore_jekyll sh

Jekyll と .NET Core のバージョン確認

/srv/jekyll # jekyll -v

ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux-musl]
jekyll 3.8.4


/srv/jekyll # dotnet --info

Host (useful for support):
  Version: 2.2.1
  Commit:  878dd11e62

.NET Core SDKs installed:
  No SDKs were found.

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1