GithubHelp home page GithubHelp logo

kamstrupmalagameetups / dockerdotnetcorejmeter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 613 KB

Repository that contains the labs from the "Docker Dotnet Core Jmeter" Meetup held at Kamstrup Malaga HQ

Home Page: https://www.meetup.com/Kamstrup-Malaga/events/256775155/

License: MIT License

Dockerfile 0.04% C# 0.22% HTML 99.70% Shell 0.04%
docker dotnet dotnet-core2 jmeter jmeter-tests kamstrup

dockerdotnetcorejmeter's Introduction

Docker with .NET Core and JMeter

With this example we'll share how can we build a sample .NET Core application running in Docker and test it using Apache JMeter running in Docker.

In Kamstrup we are working with Docker, .NET Core and JMeter and we'll share many tips from our professional experience.

This code accompanies a Meetup session for learning and is not intended for the wild!

Here bellow we can read a quick overview of the content and in each folder there is a README.md explaining more details

Prerequisites

Docker Swarm Lab

Click here to follow the Docker Swarm Lab where you will find the instructions in the README.md file to spin up three replicas of a .NET Core 2.2 Web API.

HeatMeterWebApi

In this example we are going to show use the basic DotnetCore WebApi Template application.

Code Structure

The sample application used is the basic DotNetCore WebApi template and we'll just use the bellow Values Controller.

HeatMeterWebApi.sln
	HeatMeterWebApi.csproj
		Controllers
			ValuesController.cs

Containerized .NET Core 2.2 Web API

This tutorial we'll show how to run a .Net Core Heat Meter Web Api AspNetCore application in Docker.

Docker Files Code Structure

Here we can see the code structure related with Docker

HeatMeterWebApi.sln
	HeatMeterWebApi.csproj
	DockerFile
Docker-compose.yml
.dockerignore

Instructions

You can either download the Docker image from our public Docker Hub repository

docker pull kamstrupmalaga/heatmeterwebapi

...or building it locally after cloning the Git repository in the next step.

Build the Docker image

Open a console window and navigate to the path where the Dockerfile is.

docker build --tag heatmeterwebapi .

Verify that the image has been built successfully by:

docker images

Output:

REPOSITORY	TAG	IMAGE ID	CREATED	 	SIZE
heatmeterwebapi	latest	0f0c49baaca2	5 minutes ago	260MB	

Push the Docker image to our private Docker Hub repository

docker tag 0f0c49baaca2 kamstrupmalaga/heatmeterwebapi:latest
docker login --username dockerhub_username --password ******
docker push kamstrupmalaga/heatmeterwebapi:latest

Run a Docker container from the previous image

docker run --name heatmeterwebapi --rm -it -p 8000:80 heatmeterwebapi

Output:

...
Content root path: /app
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.

Open your browser and go to http://localhost:8000/api/values to see it working. You should get the following HTTP 200 OK response:

[ "value1", "value2" ]

JMeter

We are going to test the .Net Core Web Api application running JMeter test in a Docker Container

Build Jmeter image

We are going to build a docker image with the dependencies required to run JMeter

Create simple test

We are going to show how to create some simple JMeter test

Run tests

Run the test from the Docker Jmeter Container

dockerdotnetcorejmeter's People

Contributors

felipecruz91 avatar kamstrupmalaga avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

luanng

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.