Running containerized Octopus Deploy with containerized Sql Server

Arpit Malik
2 min readNov 25, 2020

In this tutorial we are going to run an octopus deploy inside a container with sql server. Octopus deploy requires a database to store the projects, environments etc. So, we will be using sql server 2017 which will be communicating with octopus deploy in a network.

Images required to run

  1. Sql Server image : mcr.microsoft.com/mssql/server:2017-latest-ubuntu
  2. Octopus Deploy image : octopusdeploy/octopusdeploy

We will be spinning linux containers using docker compose to run both the images dependently.

version: '2.2'
services:
octopus:
image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "PASSWORD"
MSSSQL_PID: "Express"
ports:
- "1433:1433"
octopus-server:
image: octopusdeploy/octopusdeploy
environment:
ADMIN_USERNAME: "USERNAME"
ADMIN_PASSWORD: "PASSWORD"
ACCEPT_EULA: "Y"
DB_CONNECTION_STRING: Server=octopus,1433;Database=Octopus;User ID=SA; Password=PASSWORD"
ports:
- "1322:8080"

The above image is a docker-compose.yml file. The file contains two services one is sql which is used by the octopus to store data. The database will be created with the name octopus as mentioned in the file. The sql image requires password and port to be configured which will be injected as a part of connection string to the octopus-server container. Once the sql container is build the octopus-server is build. It also requires username and password for login and also the connection string of the sql. The octopus server will run on port 1322 i.e external port or mapped port with our machine. The services or the containers runs inside the same network through which they can communicate with each other.

To spin up the containers. Go to the path using cmd or vscode terminal where the docker-compose.yml resides and run command docker-compose up

Running containers

Once the command runs successfully, you will see the two containers are up and at localhost:1322 octopus is up and running.

Octopus-Server

Thanks for reading.

Happy learning :)

--

--