Setup Wireguard VPN on Docker

In this tutorial, I will demonstrate how to setup a Secure VPN using Wireguard on Docker using docker-compose and then we will use a Windows PC to connect to our Wireguard VPN using the Wireguard Client to access our Private Network in a secure way. Wireguard Configuration The following configurations should be changed, depending on your setup: TZ - timezone SERVERURL - this will be set where your client will connect to SERVERPORT - this will be set in your client config (the listen port is hardcoded to 51820) PEERDNS - this is the dns server that will be set in the client config (I use PiHole for DNS to block ads) PEERS - this is used to create configs for your clients INTERNAL_SUBNET - this is optional, but this is the subnet the connected clients will use Start the Wireguard Server The content of our docker-compose....

June 8, 2021 路 3 min 路 Ruan Bekker

Go Web Application using Docker

In this tutorial we will be building a go based application using docker and make use of multi-stage builds so that we can optimize our storage size of our image. The source code can be found on github Go Application Our go application is a simple web application that returns the hostname. This can also be a useful application if you run it with orchestrators such as Kubernetes or Docker Swarm, when using more than 1 replicas on multiple nodes, as when the application is scaled each container will respond with different hostnames....

April 23, 2021 路 2 min 路 Ruan Bekker

Run AWS Lambda Functions on Docker

In this tutorial we will demonstrate how to run local aws lambda functions with the help of docker and running it locally on a container. Dockerfile In our Dockerfile: FROMpublic.ecr.aws/lambda/python:3.8COPY lambda_function.py ${LAMBDA_TASK_ROOT}/COPY requirements.txt /opt/requirements.txtRUN pip install -r /opt/requirements.txt -t ${LAMBDA_TASK_ROOT}/CMD [ "lambda_function.handler" ]Lambda Function Our application code, residing in our lambda_function.py: import json import requests def handler(event, context): body = { "message": "this is a message", "input": event } response = { "statusCode": 200, "body": json....

April 23, 2021 路 1 min 路 Ruan Bekker

Why you should use Multi Stage Docker Builds

In this tutorial I will demonstrate how to build slim docker images using multistage docker builds, where you can save up to 800MB of disk space per image. About We will use multistage docker builds from a alpine image as our build image to get the dependencies, build the go binary and use our scratch image to place the built binary onto our target image to have small docker images....

April 21, 2021 路 3 min 路 Ruan Bekker

Run Docker Containers

In this tutorial we will demonstrate how to build a container image and how to run a docker container, as well as how to persist data and exposing host ports to reach the container ports. Assumptions I will assume that you have docker installed. Running a Container Let鈥檚 start with the basics, running a container. To run a container, we instantiate a container instance from a container image. There are thousands of container images on a container registry such as docker hub, a example that we will be working with will be the ubuntu official image....

April 5, 2021 路 8 min 路 Ruan Bekker