<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Docker file for talend job - pass context file path in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322872#M92781</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You were right, it's working!&lt;/P&gt; 
&lt;P&gt;I finally understood what you guys were saying &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;I mount the volume, put the file there as you said and pass the path as a parameter:&lt;/P&gt; 
&lt;PRE&gt;-e ARGS="--context_param context_file=/data/"&lt;/PRE&gt; 
&lt;P&gt;Thanks a lot!&lt;/P&gt; 
&lt;P&gt;Best,&lt;/P&gt; 
&lt;P&gt;Tanja&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2019 12:13:00 GMT</pubDate>
    <dc:creator>tanjaj</dc:creator>
    <dc:date>2019-12-18T12:13:00Z</dc:date>
    <item>
      <title>Docker file for talend job - pass context file path</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322868#M92777</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm trying to write a docker file to generate docker image for talnd job. And I followed this topic to write a docker file :&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/article/ka03p0000006EafAAE" target="_self"&gt;https://community.talend.com/t5/Design-and-Development/Generic-Dockerfiles-for-Talend-Jobs/ta-p/46317&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So, my talend job looks the same as in the topic above, except the value nbrows is in the context file, stored in my local folder, and when I'm running container i want to pass only path to this context file, not value of nbrows. How to write a docker file to replace hard coded path (in the Default.properties file of talend build folder) with new path to context file?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best,&lt;/P&gt; 
&lt;P&gt;Tanja&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 08:57:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322868#M92777</guid>
      <dc:creator>tanjaj</dc:creator>
      <dc:date>2019-12-16T08:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Docker file for talend job - pass context file path</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322869#M92778</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQIWAA4"&gt;@tanjaj&lt;/A&gt;,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks for trying to build Docker images with Talend &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;First, you are following a tutorial that shows you how to build Talend jobs from a Dockerfile. I just want to remind you that &lt;A href="https://www.talend.com/blog/2019/03/12/how-to-deploy-talend-jobs-as-docker-images-to-amazon-azure-and-google-cloud-registries/" target="_self" rel="nofollow noopener noreferrer"&gt;you can natively build Docker images in Studio&lt;/A&gt; if you have a "platform" license.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Now for your question, I am not sure I've fully understood what you want.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;It looks like you want to supply a context file at runtime to your container.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If so, you can achieve this in different ways.&lt;/P&gt; 
&lt;P&gt;I'll give you an example:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You can use Implicit Context Load option (in the parameters of your jobs, in the "extra" tab) to load an external context file. As you build your job as a container, you need to share this file with your host machine for the container to be able to access it. You can do so like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;docker run -v /host_machine_path/context.properties:/context.properties -it talendjob&lt;/PRE&gt; 
&lt;P&gt;Of course, the implicit context load would point to /context.properties . This way you can choose any context file at runtime.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please let me know if this is not what you were looking for.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thibaut&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 13:06:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322869#M92778</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-16T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Docker file for talend job - pass context file path</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322870#M92779</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you very much for replaying on this topic.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have tried your solution but unfortunately it's not working. Also, I have Talend Open Studio, so no build Docker file for me &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;I'm new to the docker and containers so maybe I didn't explain very well.&lt;/P&gt; 
&lt;P&gt;This is what I want:&lt;/P&gt; 
&lt;P&gt;- I have file called Default.properties which stores path to my context file, and it looks something like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt; context_file_path=C:\Users\Admin\Desktop\demo\context_file.xml&lt;/PRE&gt; 
&lt;P&gt;This variable context_file_path, my job will use to find context_file and read values from it. Structure of my context_file looks like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-15"?&amp;gt;
&amp;lt;root&amp;gt;
&amp;lt;row&amp;gt;
&amp;lt;key&amp;gt;nbrows&amp;lt;/key&amp;gt;
&amp;lt;value&amp;gt;12&amp;lt;/value&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;/root&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;When I run container it gives me an error that it can't find this path: C:\Users\Admin\Desktop\demo\context_file.xml and that is the path hard coded in Default.properties. So, I guess, I need some command like&lt;/P&gt; 
&lt;PRE&gt;sed&lt;/PRE&gt; 
&lt;P&gt;in linux, which will edit Default.properties file and pass to it new path.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Let me know if I was any clear or I made bigger confusion.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best,&lt;/P&gt; 
&lt;P&gt;Tanja&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 10:06:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322870#M92779</guid>
      <dc:creator>tanjaj</dc:creator>
      <dc:date>2019-12-17T10:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Docker file for talend job - pass context file path</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322871#M92780</link>
      <description>&lt;P&gt;I think you need to rethink this requirement a little. How are you using context variables in your job? I presume you are using a tFileInputXML and a tContextLoad. Why does the path to the file need to change? Can you not simply mount a volume and place the file in there? As far as your job is concerned, it would always be available in the same place. But it would make it easy to set context variables without having to modify your image. Take a look here:&amp;nbsp;&lt;A href="https://docs.docker.com/storage/volumes/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.docker.com/storage/volumes/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 10:45:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322871#M92780</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-18T10:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Docker file for talend job - pass context file path</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322872#M92781</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You were right, it's working!&lt;/P&gt; 
&lt;P&gt;I finally understood what you guys were saying &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;I mount the volume, put the file there as you said and pass the path as a parameter:&lt;/P&gt; 
&lt;PRE&gt;-e ARGS="--context_param context_file=/data/"&lt;/PRE&gt; 
&lt;P&gt;Thanks a lot!&lt;/P&gt; 
&lt;P&gt;Best,&lt;/P&gt; 
&lt;P&gt;Tanja&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 12:13:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322872#M92781</guid>
      <dc:creator>tanjaj</dc:creator>
      <dc:date>2019-12-18T12:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Docker file for talend job - pass context file path</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322873#M92782</link>
      <description>&lt;P&gt;No problem. Glad you got it working! I think that&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000067GwjAAE"&gt;@tgourdel&lt;/A&gt;&amp;nbsp;may deserve the "accepted solution" on this one though. If you want to add him or change it to him (you can apply more than one "accepted solution"), that would be fair &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 14:38:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Docker-file-for-talend-job-pass-context-file-path/m-p/2322873#M92782</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-18T14:38:16Z</dc:date>
    </item>
  </channel>
</rss>

