All Collections
Docker containers
Docker file specification
Docker file specification
David avatar
Written by David
Updated over a week ago

When you are building the docker image using the process described in section "Building custom docker image" you need to specify a docker file. This file needs to be in the ../resource/lib directory.

You should not have either "From", "CMD", or "ENTRYPOINT" in your docker file. These are appended by Vocareum before the build to configure the image and start the services that the platform needs. For example, you can use "RUN" command to install any software in the container or "COPY" command to copy files from ../resource/lib area to your docker image.

Note the "context" for the Docker build is set to be the "../resource/lib" directory. For example, when you execute a "COPY" command in the Dockerfile to copy files from host into the container, it should be present in the ../resource/lib directory.

Starting services

if you want specific services to be started, you can use docker supervisor directory /etc/supervisor/conf.d/ for ubuntu (and /etc/supervisord.d/ for centos). Please refer to documentation about docker supervisor for help with the format. Vocareum will start the supervisor services as a part of the initialization. For example, you can use the file "apache.conf" given below to start apache service when the server is run

[program:apache]
command=/usr/sbin/apache2ctl -DFOREGROUND
autostart=true
startretries=2
autorestart=true

Add the following line in your docker file to copy the file to the supervisor directory -

COPY apache.conf /etc/supervisor/conf.d/

Did this answer your question?