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.

Forteen 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 :-)

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.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now