Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker_Task on MacOS Project Name Issue #3248

Open
laugimethods opened this issue Jun 26, 2018 · 8 comments
Open

Docker_Task on MacOS Project Name Issue #3248

laugimethods opened this issue Jun 26, 2018 · 8 comments

Comments

@laugimethods
Copy link

Using Docker Version 18.05.0-ce-mac67 (25042) - Edge, the provided script_docker workflow fails:

[1t0@192.168.2.33;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.
[1t0@192.168.2.33;09:53:08] To deploy your application across the swarm, use docker stack deploy.
[1t0@192.168.2.33;09:53:08] Creating -50782672helloworld_1 ...
[1t0@192.168.2.33;09:53:08] �[1A�[2K
[1t0@192.168.2.33;09:53:08] Creating -50782672_helloworld_1 ... �[31merror�[0m
[1t0@192.168.2.33;09:53:08] �[1B
[1t0@192.168.2.33;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'

@laugimethods
Copy link
Author

The "project" name is by default set to the folder's name, which is not always compatible.
docker/compose#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
Copy link
Author

script_docker.xml.txt

@laugimethods
Copy link
Author

@laugimethods
Copy link
Author

@tobwiens
Copy link
Contributor

@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.

@laugimethods
Copy link
Author

laugimethods commented Jun 26, 2018

@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
]]>

@laugimethods
Copy link
Author

Take note that the myproject String should be dynamic (equals to the Workflow' project?).

@tobwiens
Copy link
Contributor

@laugimethods Thank you for adding further information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants