Generic dockerfile with --context-param switch that contains spaces

Five Stars

Generic dockerfile with --context-param switch that contains spaces

In regards to this post: Generic Dockerfile with Talend

 

I'm curious if there is a way to have a context variable that contains spaces. Currently with that dockerfile, running a job with a context and specifying "hello world" as that context and printing that context in the job will print "hello. Is there a way to configure the dockerfile or the job to allow context variables with spaces?

 

Thank you.

Thirteen Stars

Re: Generic dockerfile with --context-param switch that contains spaces

Hi,

 

sorry, it is not clear - do you want context variable name with space (no) or context variable value with space(yes)?

-----------
Highlighted
Employee

Re: Generic dockerfile with --context-param switch that contains spaces

Hi,

 

    I have tried the normal use case depicted in Mike's article and it was working fine. But I have not tried passing parameters with spaces.

 

    But when I checked some links, other docker users have overcome  the issue by passing as an array.

 

https://stackoverflow.com/questions/47179199/how-to-pass-arguments-with-space-by-environment-variabl...

 

    Could you please try solution mentioned in above example and let us know whether you were able to resolve it?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Five Stars

Re: Generic dockerfile with --context-param switch that contains spaces

Sorry for the confusion. Context variable value with space.

Five Stars

Re: Generic dockerfile with --context-param switch that contains spaces

@nikhilthampi I will try the solution in that post and get back to you. Thank you!

Five Stars

Re: Generic dockerfile with --context-param switch that contains spaces

@nikhilthampi I tried doing it that way locally but that solution doesn't work which I believe is because of the nested strings within the command. My main goal is to give the context values to a task definition. Example:

{
  "networkMode": "none",
  "containerDefinitions": [
    {
      "memory": 1024,
      "name": "testPrint",
      "image": "talend:testPrint-latest",
      "cpu": 1024
    },
    {
      "environment":
      [
          {
              "name": "ARGS",
              "value": "--context_param test=\"howdy from context\""
          }
      ]
    }
  ],
  "family": "talend-testPrint"
}

Where the environment contains the context variables within the ARGS value. So multiple "--context_param" equals multiple context variables/values. I'm thinking based on your previous answer if I could put an array in the value field or something similar.

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.