Skip to main content

Docker

Unlocking Docker's Power With Go: A Developer's Perspective - Part 2

·12 mins
In this blog post we continue our last post for most advanced use cases. We talk about managing docker containers in which we talk about spinning a container, listing, starting, stopping, and removing container. We talk about using docker network. We talk about streaming and retrieving logs from docker container. We also cover docker working with docker volumes using Go. At last, we talk about error handling and best practices.

Unlocking Docker's Power With Go: A Developer's Perspective - Part 1

·11 mins
Introduction to Docker Go SDK # In the introductory section of the blog post, we will provide a comprehensive introduction to the Docker Go SDK, highlighting its purpose, benefits, and relevance in the context of building Docker applications using the Go programming language. Brief explanation of Docker Go SDK and its benefits # The Docker Go SDK, also known as the Docker Engine API for Go, is a powerful toolkit that allows developers to interact with Docker and perform Docker-related operations using the Go programming language. It provides a set of APIs and functions that enable seamless integration with Docker, empowering developers to manage Docker resources, automate tasks, and build Docker-centric applications.

Exploring Rootless Docker

·6 mins
Introduction # Why rootless docker? “Rootless” Docker refers to running Docker containers without granting the Docker daemon full root privileges on the host system. This can provide added security, as it reduces the potential attack surface and damage that could be caused by a malicious or compromised Docker daemon. In normal Docker usage, the Docker daemon runs as the root user, which means it has complete access to the host system. While this is necessary for many Docker features and functionality, it can also represent a significant security risk, especially when running untrusted or unknown containers.

Manage Docker Environment on VPS with your Local Portainer

·2 mins
Introduction # In last post we learned to install and configure Portainer to maintain your local Docker environment. Although I’m not against command line, Portainer is a great companion if you don’t prefer to remember long commands to manager your docker. In this post I’m going to extend on last post and show how can you manage your VPS docker environment from your local Portainer installation.

Install and Configure Portainer on your Local Machine

·3 mins
Introduction # This is a quick post where I demonstrate how to install Portainer on Ubuntu. Regardless this tutorial is demonstrated on Ubuntu, you can run Portainer on whatever Docker host you are using including Windows. Most awaited Docker Desktop is available for Linux now. Still, it is a desktop application. There is also an alternative that you already might have heard of if you have worked with Kubernetes. It is called Portainer.

How to Setup a GitHub to Jenkins Pipeline with WebHooks

·11 mins
Introduction # In a typical CI/CD pipeline, what happens is when you push your code to a code repository (remote) like GitHub/GitLab/BitBucket, an event is triggered by the git host provider. This trigger is known as WebHook. This webhook can be used by some third-party service to provide an array of integrations. Do you want to tweet on every git push? You can do that.

I Tried Open edX and it's Awesome

·7 mins
Introduction # Ed-tech industry in India was valued at US$750 million in 2020, and is projected to be $1.04 billion by 2021. (source) I am documenting the process of edx installation on local system for evaluating. I’m not doing a comparision with any similar product here. Also, I’m writing this post from a develper’s perspective of course, because I’m a software developer. Don’t expect any business related expertise from here.

Continuous Integration and Deployment to Beanstalk With Docker

In a previous post we discovered how can we run commands on each push and check if the test is passing against multiple versions of go. This is a continuation of the same concept. We are going to deploy our code to Elastic Beanstalk, straight from git push. Elastic Beanstalk is nothing but a wrapper around it’s EC2 infrastructure. It is a developer-centric view of deploying an application on AWS. Developers just have to push the code and Beanstalk can take care of Auto Scaling Group, Elastic Load Balancer, databases etc. No need to manage infrastructure manually.

Create Lightweight Docker Images With Multi Staged Build

·4 mins
Me Before # 1 2 3 4 5 6 7 8 9 10 11 12 FROM golang:alpine WORKDIR /go/src/github.com/santosh/qagine COPY . . RUN go get -d RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o app . EXPOSE 8080 CMD ["./app"] Me building the image. $ docker build -t sntshk/qagine . Sending build context to Docker daemon 259.6kB Step 1/7 : FROM golang:alpine ---> 760fdda71c8f Step 2/7 : WORKDIR /go/src/github.com/santosh/qagine ---> Running in e2cf75dd1655 Removing intermediate container e2cf75dd1655 ---> 8b4955b2e885 Step 3/7 : COPY . . ---> 43cd9a41efcb Step 4/7 : RUN go get -d ---> Running in 55c01f67fa99 go: downloading github.com/gorilla/mux v1.7.4 go: downloading go.mongodb.org/mongo-driver v1.3.2 go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible go: downloading golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a go: downloading github.com/pkg/errors v0.8.1 go: downloading github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c go: downloading github.com/golang/snappy v0.0.1 go: downloading github.com/go-stack/stack v1.8.0 go: downloading github.com/klauspost/compress v1.9.5 go: downloading golang.org/x/sync v0.0.0-20190423024810-112230192c58 go: downloading github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc go: downloading golang.org/x/text v0.3.2 Removing intermediate container 55c01f67fa99 ---> 038b29b80653 Step 5/7 : RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o app . ---> Running in 122df20d3329 Removing intermediate container 122df20d3329 ---> f4616dc3fe1c Step 6/7 : EXPOSE 8080 ---> Running in 4258f9aac8c6 Removing intermediate container 4258f9aac8c6 ---> b643c7e16c0b Step 7/7 : CMD ["./app"] ---> Running in 948fa65b093b Removing intermediate container 948fa65b093b ---> 621b8e5396ad Successfully built 621b8e5396ad Successfully tagged sntshk/qagine:latest The sweet size of the image is 525MB.