Add a custom service

Use a custom service to create containers based on a Docker image. MedStack Control supports Docker Hub, private Docker registries, and any URL that hosts a Docker image. Docker Trusted Registry (DTR) is not currently supported.

  1. On the Configure page, click the cluster name.

  2. Click NEW SERVICE.

  3. Under New Custom Service, click Add New.

  4. Enter the following configuration settings, then click CREATE. Review the configuration, then click SAVE. The service is added to the cluster.


    Enter a name for the service. This will be the domain name of the service on the Docker swarm overlay network. The name must contain characters that are valid in a domain name (lowercase, a-z, 0-9, no spaces, etc).

    Note: When you create a service, all tasks share the service name. For more information, see To understand how Docker swarm routes internal network traffic using the service name, see

    Enter the Docker image name (with optional version tag). The format is

    If the image is a public image hosted on Docker Hub, no hostname is required and the version is optional (for example: postgres:11). If the image is hosted on another registry, include the URL as described in

    If the registry is private and requires authentication, you must configure the registry first. For details, see Add a registry.

    If provided, this command will be executed by the container when it starts. This is equivalent to CMD in a Dockerfile ( or in a Docker compose file (

    The arguments for the command, if one is provided.

    If you want the service to be accessible from the internet, see Hosts. If you want the service to be internally accessible from a hostname different from the service name, set the value here. For details, see

    The target number of containers to be run by the service. Service constraints will determine which nodes the containers run on.


    If the service should be exposed to the public internet through a Load Balancer, enter the following configuration settings.

    Enter the port the container exposes (e.g. PORT in the Dockerfile). The Load Balancer will proxy from the public facing HTTPS port to this port on the container.

    A list of one or more domain names that are configured in DNS to point to the node IP. If you wish your domain to be served by this container, create a DNS A record in your DNS provider (e.g. GoDaddy Point the DNS record at the IP address of any of the nodes in your cluster, preferentially the manager node.


    Environment variables are equivalent to the environment key in Docker Compose (for details, see If you have many environment variables, you can use Secrets instead.

    1. Click ADD ENVIRONMENT VARIABLE. Enter the variable name and value.
    2. To remove a variable, click X.


    You can use placement constraints to control the placement of containers. For details, see and

    1. Click ADD CONSTRAINT. Enter the constraint.
    2. To remove a constraint, click X.


    Select the secrets you want to use with the service. The secret data will be mounted as a file inside the container. For details on creating secrets, see Manage secrets.

    1. Click ADD SECRET. Enter the name, filename, UID, GID, and Mode. For details, see
    2. To remove a secret, click X.


    You can use mounts to allow multiple containers on the same node to share the same data. Mounts can’t be used for containers on separate nodes. Using mounts is not generally recommended since containers may move from one node to another for a variety of reasons.

    1. Click ADD MOUNT. Enter the target and source. For details, see
    2. To remove a mount, click X.


    Select the configs you want to use with the service. For details on creating configs, see Manage configs.

    1. Click ADD CONFIG. Enter the name, filename, UID, GID, and Mode. For details, see
    2. To remove a config, click X.

Still need help? Contact Us Contact Us