Jenkins with .net core on docker container

Build .net Coreไม่ได้!!

  • Docker (Linux Container) (ฺBase image มีขนาดไฟล์เล็กกว่าของฝั่ง Windows มากๆ ครับ เลยเลือกใช้งานตัวนี้แทน)
  • VS Code
  • Internet
Docker extension for VS Code
Create new Dockerfile
FROM jenkins/jenkins:latest
MAINTAINER Vatthanachai W.(vatthanachai.w@gmail.com)
USER root
RUN apt-get update && \ 
apt-get upgrade -y && \
apt-get dist-upgrade -y
RUN apt-get install -y apt-transport-https \
&& apt-get install -y --no-install-recommends \
curl libunwind8 gettext apt-transport-https && \
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg && \
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg && \
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/dotnetdev.list' && \
apt-get update
RUN apt-get install -y dotnet-sdk-2.1 && \
export PATH=$PATH:$HOME/dotnet && \
dotnet --version
RUN apt-get clean && apt-get autoremove -y
USER jenkins
All code
Vs Code >> Terminal
$> docker build -t jenkin-netcode:2.1 .
Build Image Inprogress
After build image success
$> docker images
$> docker run -d -p 8080:8080 --name jenkins jenkin-netcode:2.1
Jenkins Start page
$> docker logs <Container ID || Container Name>
$> docker logs jenkins
Jenkins initial setup password
Jenkins’s plug-in install
Create new project in jenkins
mkdir hello && \
cd hello && \
dotnet new console && \
dotnet build

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
วัฒนชัย วงศ์ประเสริฐ

วัฒนชัย วงศ์ประเสริฐ

Rogue Planet

More from Medium

Build .Net Core REST API and Angular Application using Docker

How does a middleware pipeline implementation look like?

Pushing a local docker image to Amazon ECR Repository using .NET 5, C# and AWS ECR SDK

PostgreSQL: Single Server Migration to Flexible Server using Azure DMS