scheduling
scheduling copied to clipboard
Docker_Task on MacOS Project Name Issue
Using Docker Version 18.05.0-ce-mac67 (25042) - Edge, the provided script_docker workflow fails:
[[email protected];09:53:08] Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node. [[email protected];09:53:08] To deploy your application across the swarm, use docker stack deploy. [[email protected];09:53:08] Creating -50782672helloworld_1 ... [[email protected];09:53:08] [1A[2K [[email protected];09:53:08] Creating -50782672_helloworld_1 ... [31merror[0m [[email protected];09:53:08] [1B [[email protected];09:53:08] ERROR: for -50782672_helloworld_1 Cannot create container for service helloworld: b'Invalid container name (-50782672_helloworld_1), only [a-zA-Z0-9][a-zA-Z0-9.-] are allowed'
The "project" name is by default set to the folder's name, which is not always compatible. https://github.com/docker/compose/issues/2982
To fix that issue, the name of the project has to be specified through environmental variables (export COMPOSE_PROJECT_NAME=myproject) or at runtime: docker-compose -p myproject up
@laugimethods Thank you for reporting this issue.
A fast workaround is to change the docker-compose command in the config/scriptentinges/docker-compose.properties
. One could force the project there to something.
With the current functionality we cannot overwrite environment variables, because all variables are injected by proactive with prefix.
Imho an interestting solution is to allow the user to specify docker-compose arguments as Generic Information.
@tobwiens Whatever is the solution, the provided workflows have to behave as expected right away... To solve that issue, as shown in the provided files, there is at least two options that only require a change of the Workflow (however not a permanent nor universal fix):
<code language="bash">
<![CDATA[
echo "version: '3'
services:
helloworld:
image: busybox
command: echo 'Hello ProActive'" > docker-compose.yml
docker-compose -p myproject up
]]>
</code>
or
<![CDATA[
echo "version: '3'
services:
helloworld:
image: busybox
command: echo 'Hello ProActive'" > docker-compose.yml
export COMPOSE_PROJECT_NAME=myproject
docker-compose up
]]>
Take note that the myproject
String should be dynamic (equals to the Workflow' project?).
@laugimethods Thank you for adding further information.