Docker Community Forums

Share and learn in the Docker community.

Running a custum application on docker


(Rufa) #1

Hello,

I just started to run some applications like apache, mysql, … on docker and now i’m trying to run a custom application (only a bash script with .so files) on Docker, this application not need any environment setup just a Linux fresh installation because all that application needs is inside one folder.

Please how can i do that ?

Thanks.


(David Maze) #2

The Docker documentation has a very good tutorial on building and running custom images.


(Rufa) #3

Hello,

Thanks for the reply, as my application is just a bash script with everything included in one folder so we need just to import a Debian or Ubuntu image, create a new container, copy the hole folder in /opt or anywhere and run the script.

Regards.


(David Maze) #4

To reiterate, the Docker documentation has a very good tutorial on building and running custom images. The image you describe should be very easy to build; the Dockerfile will look something like

FROM ubuntu:16.04
COPY myapp.sh /usr/bin
RUN chmod 0755 /usr/bin/myapp.sh
CMD ["myapp.sh"]

and then you can run

docker build -t myimage .
docker run --rm -it myimage

(Rufa) #5

Hi @dmaze

Yes this is very helpful

Thanks.