

Working with a Dockerfileįirst, let’s open the Dockerfile in the root of the project. Click the OK button to create a server configuration. Once Docker is installed in your system, go to Settings/Preferences | Build, Execution, Deployment | Docker, and click on the + button to add a new Docker server connection.īy default, the plugin will create a connection to the local machine Docker server, which is good enough for our tutorial. Instead, we’ll start by configuring a Docker server so that we can run our application. This tutorial won’t cover how to install and configure Docker for your system. The project structure should be similar to the one found at this repository.

We can create a new Go Modules project or use an existing one. Note: While older versions of the IDE will work to a certain degree, this article makes use of new features, and the appearance of the IDE may be different. We’ll also need a reasonably modern version of Docker, such as 17.06 or newer. Let’s start with a presentation of the normal Docker workflow, then we’ll build our container and run it.īefore we continue, we’ll need GoLand 2020.1.1 or newer, which ships with the latest Docker plugin. We’ll look at how to configure the project in the IDE, how to use either Docker or Kubernetes to run or debug our project, and how to connect the project to our database of choice, PostgreSQL. Today we start a miniseries of articles about the support inside GoLand for Docker, Docker Compose, and Kubernetes and how it can help us write (micro-)services in Go.

Running Go applications using Docker Compose in GoLand.Debugging a Go application inside a Docker container.Go development with Docker Containers (this post).You may also refer to the Docker and Kubernetes sections of our Help documentation. You can find more tutorials on how to use containers here. Updated and validated on November 17, 2022.
