Containerize Software Development

Hey Guys,

I am new to docker and I tried my first Container.
I wanted to capsulate all my needed development softare inside one Container. For development I start the container and work with the needed programms.
Therefore I need the programms firefox, google chrome, intellij and some other terminal stuff.

The building complets the image.
During the build there are some messages:
debconf: delaying package configuration, since apt-utils is not installed
suggested packages:
xxxx
recommand packages
xxxx

Starting the container doesn’t work:
/bin/sh: 1: [/bin/sh]: not found → I understand the error, but why?

The docker image becomes realy huge (6.15GB) is this normal?

Last question:
Is it possible to start intellij aqua inside the container but show the UI on my local machine?

FROM ubuntu:latest

WORKDIR /usr/src/app

RUN apt-get update && apt-get install -y apt-utils wget gnupg2 software-properties-common

# Google Chrome
RUN wget -O /tmp/google.pub https://dl-ssl.google.com/linux/linux_signing_key.pub
RUN gpg --no-default-keyring --keyring /etc/apt/keyrings/google-chrome.gpg --import /tmp/google.pub
RUN echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list

# Firefor Repository
RUN add-apt-repository ppa:mozillateam/ppa -y
RUN echo 'Package: *\nPin: release o=LP-PPA-mozillateam\nPin-Priority: 1001' | tee /etc/apt/preferences.d/mozilla-firefox

# Intellij Aqua
RUN mkdir -p /opt/intellij-aqua
RUN wget -O /opt/intellij-aqua.tar.gz https://download.jetbrains.com/aqua/aqua-2024.3.1.tar.gz
RUN tar -xzf /opt/intellij-aqua.tar.gz -C /opt/intellij-aqua --strip-components=1
RUN rm -r /opt/intellij-aqua.tar.gz

RUN apt-get install -y git ranger tmux nodejs npm google-chrome-stable firefox
RUN apt-get clean

ENTRYPOINT [/bin/sh]

Thanks for help :smiley:

What you are doing is not what Docker containers are for and you need a virtual machine that supports desktop apps as well. Since a Docker image is light weight, if you install Desktop apps, the size can drastically increase as it downloads all the dependencies to support the GUI or the app that has lots of dependencies as it was not made for containers.

We also don’t start a shell in a container, especially not as an entrypoint. And it would work only if the container is started with an interactive terminal.

But the error message just says you want to execute a command called “[/bin/sh]” which does not exist in the container. Which is true. The entrypoit is either as string or a json, but then you need quotas like ["/bin/sh"]

It is still not what you should do. Installthe browser and IDe on your can install nodejs and other dev tools in the container that can be used in the command line.

1 Like

It seems that I misunderstood how to use Docker.
It is definitely possible to install NodeJS and other libraries needed for programming.
IDEs and other graphical tools need to stay outside of Docker and run on my desktop.

So would graphical editing outside the container and running on the console inside the container be the best approach?

You can run VSCode in a container and access it via browser. That way you are ready to develop from any device :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.