Skip to content

This repository includes the Dockerfile and Docker compose file required to make the dev environment.

Notifications You must be signed in to change notification settings

vijaydharmaji29/docker-dev-env-files-e6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Creating our Docker Dev Environment

Prerequisites:

  1. Basics of Docker. If you are not familiar with docker please watch this video.
  2. Docker Desktop needs to be installed on your machine. You can refer to the installation guide from Docker for the same for your specific machine.

Requirements for the Environment

  1. Linux Based: Ubuntu 24:04
  2. Java Version: JDK 22
  3. GCC/C++ Compiler
  4. Build Tools: Gradle for Java and CMake for C++

What is a Docker Dev Environment?

A Docker dev environment allows developers to work with consistent, isolated setups that can be easily shared and deployed across different machines and platforms

Downloading the Dockerfile and Docker Compose

In your working directory for your code which you want to make accessible to the container, download the Dockerfile and compose-dev.yaml from this repo.

Your folder should now have both of the above-mentioned files.

Creating the Dev Environment

Open Docker Desktop and navigate to Dev Environments situated in the left panel.

Screenshot 2024-09-05 at 12.08.40 AM.png

Click on Create to start creating a new dev environment

For the Setup section give the container any name you prefer and set the path to the directory with the Dockerfile and compose-docker.yaml files.

Click next and Docker will create your environment.

Running the container with an interactive terminal

From Docker Desktop run the docker dev container by clicking on the Play button.

To open the interactive terminal for the container:

Get the container id:

docker ps

My Output:

CONTAINER ID   IMAGE               COMMAND            CREATED             STATUS         PORTS     NAMES
771625b30774   ubuntu-dev-e6-app   "sleep infinity"   About an hour ago   Up 9 seconds             ubuntu-dev-e6-app-1

Copy the container id from the CONTAINER ID column for your particular dev container name.

Opening the interactive terminal for the container

docker exec -it <container_id_or_name> /bin/bash

This opens the internal BASH for the container.

Running the project directly from IntelliJ

You can refer to this link for instructions on how to run directly on the docker image.

Set the Context Folder to the directory with the previously downloaded Dockerfile.

About

This repository includes the Dockerfile and Docker compose file required to make the dev environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published