<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by sebastian gomez on Medium]]></title>
        <description><![CDATA[Stories by sebastian gomez on Medium]]></description>
        <link>https://medium.com/@sebagomez?source=rss-6f41b7faa0f2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*a7sd1NL2FtIII2bVrPTqcA.jpeg</url>
            <title>Stories by sebastian gomez on Medium</title>
            <link>https://medium.com/@sebagomez?source=rss-6f41b7faa0f2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:50:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sebagomez/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Windows Containers (personal) cheat sheet]]></title>
            <link>https://medium.com/@sebagomez/windows-containers-personal-cheat-sheet-95c1c4d6bdf5?source=rss-6f41b7faa0f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/95c1c4d6bdf5</guid>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[windows-containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[sebastian gomez]]></dc:creator>
            <pubDate>Fri, 08 Feb 2019 19:44:53 GMT</pubDate>
            <atom:updated>2019-02-08T19:44:53.830Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been struggling to get a web app (ASP.NET 4) with some ReST services in a Windows Container. It was actually three different apps, two of them are web applications and the other is just a big batch process which must be called via MSBuild.</p><p>More than a cheat sheet, this is just a note for my future self… and maybe it’ll help someone along the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*beCotwn_ZPXuBw4FvSGGRA.jpeg" /><figcaption>image source: <a href="https://blog.newrelic.com/culture/dockercon-sf/">https://blog.newrelic.com/culture/dockercon-sf/</a></figcaption></figure><p>Here’s my dockerfile, I’ll go thru each line below 👇</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7db555a5ac267fa186fe2e48bb37f5fa/href">https://medium.com/media/7db555a5ac267fa186fe2e48bb37f5fa/href</a></iframe><p>Here we go:</p><pre># escape=`</pre><p>The escape char is used to span multiple lines. The default char is the backslash \ but since that’s also Windows directory separator it would get messy. That line can only be at the beginning, and the backtick `is the only possible value (other than the default). Read more about the <a href="https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile#escape-character">escape char</a>.</p><pre>FROM microsoft/dotnet-framework:4.7.2-runtime</pre><p>I’ll start from that image since it’s the needed runtime for my applications.</p><pre>LABEL MAINTAINER=&quot;Seba Gómez &lt;sgomez@genexus.com&gt;&quot;</pre><p>Just me</p><pre># GeneXus<br>COPY GeneXus/ c:/GeneXus<br>RUN C:/GeneXus/Genexus.com /install &amp;&amp; `<br>    powershell -Command &quot;Copy-Item C:/Users/ContainerAdministrator/AppData/Roaming/GeneXus C:/Windows/SysWOW64/config/systemprofile/AppData/Roaming -Recurse&quot;</pre><pre>COPY Artech.* c:/GeneXus/</pre><pre># GeneXus M Service<br>COPY GXM_Services/ C:/GXM_Services<br>COPY LocalSettings.json C:/GXM_Services/GXM_Services/Services/Settings.json</pre><pre># GeneXus Server<br>COPY GeneXusServer/ C:/GeneXusServer</pre><p>This is just the copy from my host into the container. Those are the different applications that will be eventually running there. I do want to take a minute on this line:</p><pre>RUN powershell -Command &quot;Copy-Item C:/Users/ContainerAdministrator/AppData/Roaming/GeneXus C:/Windows/SysWOW64/config/systemprofile/AppData/Roaming -Recurse&quot;</pre><p>It doesn’t matter what I’m copying there but let me tell why I’m doing that. There’s a command I ran before that copies some files into the <strong>%AppData%</strong> directory. But the <strong>%AppData%</strong> directory is related to the current user… so I ran that at build time (docker build) and one of my applications tried to look for those at execution time and could not find them. Why? Because whoever copied the files is not the same user that is looking for those files. I have to copy them (manually) the where the running application will be looking for them, and that is the LocalSystem account <strong>%AppData%</strong> folder. (<a href="https://serverfault.com/questions/9325/where-can-i-find-data-stored-by-a-windows-service-running-as-local-system-accou">Stack Overlow FTW!</a>)</p><pre>#ENABLE IIS<br>RUN powershell -Command `<br>    Add-WindowsFeature Web-Server; `<br>    Add-WindowsFeature NET-Framework-45-ASPNET; `<br>    Add-WindowsFeature Web-Asp-Net45; `<br>    Add-WindowsFeature NET-WCF-TCP-Activation45; `<br>    Add-WindowsFeature NET-WCF-HTTP-Activation45; `<br>    Add-WindowsFeature Web-WebSockets; `<br>    New-WebAppPool GeneXusServerAppPool; `<br>    New-WebApplication -Name GeneXusServer -Site &#39;Default Web Site&#39; -PhysicalPath C:\GeneXusServer\VDir -ApplicationPool GeneXusServerAppPool;</pre><p>I then need to enable the IIS, I could have used one of those asp.net images… honestly?, I remember trying tons of stuff and this is the one that finally worked for me. So, I enable the Web-Server, and all those features you see there. I need all of them, maybe you don’t. This RUN command follows the <a href="https://docs.docker.com/develop/develop-images/dockerfile_best-practices/">best practices</a> of keeping a bunch or RUN instructions in one single line. This is where we see the escape character, see it at the end of (almost) every line?</p><pre># Change AppPool properties<br>RUN c:\windows\system32\inetsrv\appcmd.exe set app /app.name:&quot;Default Web Site/&quot; /enabledProtocols:&quot;http,net.tcp&quot; &amp; `<br>    c:\windows\system32\inetsrv\appcmd set apppool /apppool.name:GeneXusServerAppPool /enable32BitAppOnWin64:true &amp; `<br>    c:\windows\system32\inetsrv\appcmd set apppool /apppool.name:GeneXusServerAppPool /processModel.identityType:&quot;LocalSystem&quot; &amp; `<br>    c:\windows\system32\inetsrv\appcmd set apppool /apppool.name:GeneXusServerAppPool /managedRuntimeVersion:&quot;v4.0&quot;</pre><p>I also discovered an IIS tool called <a href="https://docs.microsoft.com/en-us/iis/get-started/getting-started-with-iis/getting-started-with-appcmdexe">AppCMD</a>. There’s probably a better (PowerShell?) way of doing what I needed but I couldn’t find it. So after long hours, I figured out how to change everything I needed. Again, this is dead simple with the IIS tools, enable protocols, change the identity and set the runtime of the application pool is just a click away with GUI, not with just a command line.</p><pre># Enable https<br>COPY tools/enable_https.ps1 C:/tools/<br>RUN powershell -File .\tools\enable_https.ps1</pre><p>This one is kind of embarrassing, cause I didn’t know how to do it in one or many lines in the dockerfile. So I found a little PowerShell script online and used that one to create a certificate and install it in my IIS for https support.</p><p>This is all the script does 👇</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e75c82c5f363b37b6b4419ce5b3d836f/href">https://medium.com/media/e75c82c5f363b37b6b4419ce5b3d836f/href</a></iframe><p>I would like to know how to do this straight in the dockerfile, if you know how to do it, please let me know.</p><pre>#Install Chocolatey<br>RUN powershell -Command Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString(&#39;https://chocolatey.org/install.ps1&#39;))</pre><p>Install <a href="https://chocolatey.org/">Chocolatey</a>. Chocolatey is the package manager for Windows, is like Windows’s apt-get or whatever you use on your Mac. It’s awesome, you need to start using it in your daily basis, and it’s a must when working with Windows Containers (you’ll see why next).</p><pre># Install Microsoft Visual C++ Redistributable for Visual Studio 2017, URLRewrite Module and SQL Server CMD Utilities (BCP)<br>RUN choco install vcredist140 -y &amp; `<br>    choco install urlrewrite -y &amp; `<br>    choco install sqlserver-cmdlineutils -y</pre><p>I need to install VC++ redistributable package, the URL rewrite module for IIS and the SQL Server command-line utilities because I need the <a href="https://docs.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-2017">bcp utility</a>. All that is magically done by chocolatey. Seriously, go check chocolatey out.</p><pre># Install the Java SDK and Tomcat 8<br>RUN choco install jdk8 -y &amp; `<br>    choco install tomcat -y  -params &quot;unzipLocation=C:\\Tomcat8&quot;</pre><p>I’ll also be running some Java web applications in that container, so I need to install the Java JDK and Tomcat 8.5</p><pre># Set the needed Tomcat registry values<br>RUN powershell -Command `<br>    New-Item -Path &#39;HKLM:\SOFTWARE&#39; -Name &#39;Apache Software Foundation&#39;; `<br>    New-Item -Path &#39;HKLM:\SOFTWARE\Apache Software Foundation&#39; -Name &#39;Tomcat&#39;; `<br>    New-Item -Path &#39;HKLM:\SOFTWARE\Apache Software Foundation\Tomcat&#39; -Name &#39;8.5&#39;; `<br>    New-Item -Path &#39;HKLM:\SOFTWARE\Apache Software Foundation\Tomcat\8.5&#39; -Name &#39;Tomcat8&#39;; `<br>    Set-ItemProperty -Path &#39;HKLM:\SOFTWARE\Apache Software Foundation\Tomcat\8.5\Tomcat8&#39; -Name &#39;InstallPath&#39; -Value &#39;c:\Tomcat8\apache-tomcat-8.5.12&#39;</pre><p>Also, my application tries to read the registry to know where the Tomcat is installed, unfortunately (for me) installing Tomcat via chocolatey is just like unzipping the files and does not write anything in the registry. So I had to write the needed entries myself. That’s another time when PowerShell came in handy.</p><pre># Install Tomcat as Windows Service (and set its StartType to Automatic)<br>RUN C:/Tomcat8/apache-tomcat-8.5.12/bin/service.bat install &amp; `<br>    powershell Set-Service -Name Tomcat8 -StartupType Automatic</pre><p>After that I realized that Tomcat was not starting as a service, so I had to install it and update its StartType as Automatic so it would start right away with my container.</p><pre># Install the Microsoft .NET Core SDK and Windows Server Hosting<br>RUN choco install dotnetcore-sdk -y &amp; `<br>    choco install dotnetcore-windowshosting -y</pre><pre>ENV DOTNET_CLI_TELEMETRY_OPTOUT 1</pre><p>I also need to run .NET Core applications, so I need to install the .NET Core SDK, because I’ll be building a project, and the Windows Server Hosting because the application will run on IIS. The last line sets the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 so I don’t see an ugly output, but it has not worked, I still see it and don’t know why.</p><pre>EXPOSE 80 80/udp 8001 8001/udp 8080</pre><pre>ENTRYPOINT [&quot;powershell&quot;, &quot;Get-Content&quot;, &quot;C:\\GXM_Services\\GXM_Services\\GXMBLServices.log&quot;, &quot;-Wait&quot;, &quot;-Tail 1&quot;]</pre><p>Finally, I need to expose the needed ports and set the ENTRYPOINT. The ENTRYPOINT is also something I fixed with PowerShell. The container had nothing exposed to the standard output, so when you started the container or tried to see the logs via docker logs nothing was there. So again, PowerShell came very handy with the command <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-content?view=powershell-6">Get-Content</a>. So what I’m doing there is printing out the last line of a log file and wait for newer lines to show up.</p><p>Looks simple now but it took me a while to configure everything I needed, especially the changes to the Application Pool.</p><p>Someday this will all be .NET Core, but right now it’s plain .NET Framework 4.7, thus, the need for a Windows Container.</p><p>When doing this I faced many tasks that are very easy to solve using Windows GUI, but that’s something that’s just not there in containers. So you’ll have to use simple CMD or PowerShell commands. I’m not a PowerShell wiz, I had to learn a lot of stuff but it’s totally worth it, if you’re not familiar with PowerShell yet, you should definitely get a big cup of coffee (or mate) and start playing with it.</p><p>Know how to improve this Dockerfile? please let me know in the comments and I’ll update it accordingly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95c1c4d6bdf5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up a GitHub page with Jekyll and a Docker container]]></title>
            <link>https://medium.com/@sebagomez/setting-up-a-github-page-with-jekyll-and-a-docker-container-c712e448649b?source=rss-6f41b7faa0f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c712e448649b</guid>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[jeky]]></category>
            <dc:creator><![CDATA[sebastian gomez]]></dc:creator>
            <pubDate>Wed, 28 Nov 2018 13:04:37 GMT</pubDate>
            <atom:updated>2018-11-28T13:04:37.459Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>TL;DR</em></strong><em>: I built my static personal site (</em><a href="https://sebagomez.github.io/"><em>https://sebagomez.github.io/</em></a><em>) using a container instead of installing all the needed runtime/build for Jekyll which includes Ruby and who knows what else.</em></p><p>I came across a very cool personal site lately (<a href="https://jarrekk.github.io/Jalpc/">https://jarrekk.github.io/Jalpc/</a>) and I thought it was time to revamp my old GitHub Page with something useful. The repo of the site was hosted on GitHub so I thought I could just fork the repo myself and update it with my data. WRONG!</p><p>After forking the repo I realized it was something called Jekyll. I had heard about Jekyll before but had no idea what it was, less how to use it. I started to read a little about it to find out I had to install Ruby. Don’t get me wrong, I have nothing against Ruby, but I don’t want to install anything else on my PC. Especially another runtime/build tools.</p><p>So before deleting the project and forget all about the site, I thought I could spend 2minutes looking for a container with the needed tools. Lucky me! I found the right container (jekyll\jekyll:builder).</p><p>So this is what I did to get my site without knowing anything Jekyl (or Ruby). <br>The first thing I did was to start a container based on that image, I noticed that `jekyll serve` starts a web server in port 4000 so I added the -p flag and the -v to mount my files inside the container. This is the command I ran:</p><pre>docker run — rm -v c:/code/sebastian/Jalpc:/srv/jekyll -p 4000:4000 -it jekyll/jekyll:builder bash</pre><p>I created a batch file that fires up the container.<br>Once inside the container in the bash prompt you could just type `<em>jekyll serve</em>`. This command will build the static site and fire up a web browser to it on port 4000.</p><p>And that’s it. That’s how you build the site, but now you’ll have to push it to your &lt;username&gt;.github.io repository, so this is my solution… it might be a better one I’m not aware of, so this is what I did.</p><p>The generated static site is located under the _site folder, so I created another batch file called deploy.cmd that does exactly that… it’ll copy the files under _site to another repo in my local machine that has a remote against my sebagomez.github.io repo</p><pre>robocopy _site\ ..\github.io *.* /E /XF *.cmd *.md</pre><p>After everything is copied, all I need to do is go to the github.io repo and commit/push the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXWMTcAGR433Zjl8J-FItw.gif" /></figure><p>Why did I do it that way?</p><p>The problem is the _site folder is ignored in the original repo, and of course, we want to keep it that way. And there’s no (known by me) way of adding another remote repo with a different .gitignore file, so I didn’t know how to solve that. This is the best solution I could come up with, I’m open to suggestions on how to improve this design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*ldOBeIDjHZSY6CatP9ZOkg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c712e448649b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The power of loving what you do]]></title>
            <link>https://medium.com/@sebagomez/the-power-of-loving-what-you-do-858dad03bbff?source=rss-6f41b7faa0f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/858dad03bbff</guid>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[genexus]]></category>
            <category><![CDATA[bttf]]></category>
            <category><![CDATA[gx28]]></category>
            <dc:creator><![CDATA[sebastian gomez]]></dc:creator>
            <pubDate>Sat, 18 Aug 2018 03:22:04 GMT</pubDate>
            <atom:updated>2018-08-18T03:22:04.366Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*cOtf9quJZrhwjq54xA9oyA.jpeg" /><figcaption>Marty McFly playing Johnny b. Goode</figcaption></figure><p>A new <a href="https://www.genexus.com/gx28">GeneXus Meeting</a> is upon us. I know, we’re more than a month away from it, but for us, it’s just around the corner.</p><p>I don’t know if people are aware of this but this meeting is entirely organized by the whole company, finding the location, fixing up the streaming, making sure everything runs smoothly is a task we all engage (and take pride) in.</p><p>The claim and the “look and feel” of the meeting is also something that is done by our awesome marketing team. And this year, in particular, I think they hit it out of the ballpark. The claim for the #GX28 is “The power of doing”, which I think it perfectly reflects why we throw this massive event.</p><p>Why do we do it? why do we give these presentations for free? why do people from around the globe gather in this small country in South America to hear about the new trends in technology?<br>Because we’ve have proved over the years that we’ve done stuff.</p><p>Why will I be giving a presentation about containerized applications? Because I use Docker containers every day; because I think it is awesome what can be done with them and I want to share that with whoever wants to hear me out.</p><p>Why will I be also talking about the state of the art of the chatbots ecosystem and conversational interfaces? Because we have been studying a lot about them. Because I created my first chatbot (RUDI) for the #GX26, over two years ago, and we managed to create a Chatbots generator, which will be released during the meeting.</p><p>Am I an expert on these subjects? Hell no! <br>Could I be wrong? Of course!</p><p>But we’ll all be talking about our experiences, and in these matters, we have a lot.</p><p>Why? Because we love what we do, and that, with the fact the <a href="https://www.imdb.com/title/tt0088763/">Back to the Future</a> is my all time favorite movie, is why I called this post “The power of loving what you do”.</p><p>In case you’ve been living under a rock for the past 30 years, here’s Huey Lewis and the News’ “Power of Love”</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FKCkgYhtz64U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKCkgYhtz64U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FKCkgYhtz64U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d13bbea506ebf6c9bcb5a14e83a156f3/href">https://medium.com/media/d13bbea506ebf6c9bcb5a14e83a156f3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=858dad03bbff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I personally use Docker for]]></title>
            <link>https://medium.com/@sebagomez/what-i-personally-use-docker-for-223d3a9ec8c3?source=rss-6f41b7faa0f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/223d3a9ec8c3</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[sql-server]]></category>
            <dc:creator><![CDATA[sebastian gomez]]></dc:creator>
            <pubDate>Fri, 25 May 2018 03:28:06 GMT</pubDate>
            <atom:updated>2018-05-25T03:28:06.887Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*NDRSvzNCEG0yRvNiz_EttA.png" /></figure><p>I&#39;ve been writing about Docker lately and it has bought some attention. I got many claps on my latest post on how to use the Docker for Windows client from WLS, you can check it out <a href="https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4">here</a>.</p><p>But today I wanted to share what I use Docker for and why I found it super useful. It&#39;s one of those things that are so useful to me right now that got me into writing this post thinking it can help others, I need to spread the word.</p><p>I&#39;m not a Docker wiz, I have not used Docker or any orchestration solution for production environments, but I do have some scenarios where I found Docker to be extremely useful.</p><p>My typical scenario is where I need to try or test something whose runtime I don&#39;t have in my everyday dev machine. Like Ruby, or Python, I don&#39;t have those runtimes installed. I use Windows and we all know what happens when you install too much crap on your machine. But still, sometimes I want (need?) to try something written in one of those languages I can run on my machine, most of the time, when I pull something from GitHub.</p><p>But recently I&#39;ve found another cool use, which is having the possibility to test many DBMSs in my dev machine, without the need to install anything (other that Docker for Windows of course).</p><p>My day to day DBMS is SQL Server, I have an &quot;old&quot; 2014 instance which is currently stopped, and a 2016 instance. Sometimes I want to test some of the newer features of SQL Server 2017, should I install that on my machine? Heck no! Docker to the rescue.</p><p>I have a bat file in my PATH called sqlserver.bat which starts a SQL Server 2017 instance with just one line:</p><pre>docker run --rm -p 1533:1433 -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=dbPassword! -e MSSQL_PID=Developer -d --name sqlserver microsoft/mssql-server-linux:2017-GA</pre><p>This command will start a local instance of SQL Server 2017 running on a Linux container on my Windows machine, how cool is that?&#39;</p><p>Let me go thru the parameters real quick: <strong><em>rm</em></strong> tells the engine to remove the container when it is stopped, that’s what I use cause I use the instance for one test at a time (every time). The <strong><em>p</em></strong> makes the port of the SQL Server (1433) engine be seeing on my host on the 1533 (because I already have SQL Server on the host). There are two environment variables that need to be set <strong><em>ACCEPT_EULA</em></strong> to <strong><em>Y</em></strong> and <strong><em>MSSQL_SA_PASSWORD</em></strong> to whatever you want your admin user (SA) to be. Keep in mind there’s a <a href="https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker">policy</a> for this password. The <strong><em>d</em></strong> parameter is because I want the container to run detached of my command line, and <strong><em>name </em></strong>is obviously the name of the container.</p><p>So, now what? Well, if you believe me you there’s a SQL Server running on a Linux container on your Windows machine. But you don’t have to just believe me, and you can try it yourself. Open SQL Server Management Studio and try to connect to <strong><em>localhost,1533</em></strong> using the SQL Server Authentication provided above (<strong><em>SA </em></strong>and the password set in the MSSQL_SA_PASSWORD environment variable).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*blXuSkR2lF1Hboa6q4UdZg.png" /><figcaption>Entering my SQL Server</figcaption></figure><p>I can even create <a href="http://genexus.com/">GeneXus </a>Knowledge Bases in that SQL Server instance, all I have to do is set this same credentials in the Create Knowledge Base dialog, also pointing at my localhost with the provided port (separated by a coma).</p><p>Also, maybe I need to test PostgreSQL or MySQL. I do have two more bat files to fire up these DBMS:</p><pre>docker run --rm -p 3306:3306 -e MYSQL_ROOT_PASSWORD=dbPassword -d --name mysql mysql:5.7.19</pre><p>This one is called mysql.bat (of course) and will fire up an instance of MySQL, and the following:</p><pre>docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=dbPassword --name postgres postgres:10-alpine</pre><p>is called, you guessed it, postgresql.bat and it will fire up a PostreSQL instance.</p><p>When I’m done, it would just stop the container, and because of the <strong><em>rm</em></strong> flag, that will remove the container.</p><pre>docker stop sqlserver</pre><p>It’s out of the scope of this post, but you might have the need to keep the created Databases in your containers. In that case, every DBMS image has a way to provide the volume you should mount so the created databases are persisted in your host file system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*oRulsP1UcRFWS00eXNtE2Q.gif" /><figcaption>bat files in action</figcaption></figure><p>That&#39;s it for now, for my next trick I&#39;ll need an X Window server and an Ubuntu base image. <a href="https://twitter.com/sebagomez/status/999307995954720768">It&#39;s awesome</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=223d3a9ec8c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing the Docker client on Windows Subsystem for Linux (Ubuntu)]]></title>
            <link>https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4?source=rss-6f41b7faa0f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/612b392a44c4</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[wsl]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[sebastian gomez]]></dc:creator>
            <pubDate>Fri, 20 Oct 2017 17:27:55 GMT</pubDate>
            <atom:updated>2019-08-12T16:23:59.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BR7gFwL2DV4mw1r1pGVQaQ.png" /></figure><p>I&#39;m a PC guy, I have always been. I played around a little bit with Linux back in the university days, but that was it.</p><p>But now, Windows brought Linux a little closer. I don&#39;t have to do anything complicated like dual booting or having another computer set up just to experience the Linux (non-GUI) environment.</p><p>As a Windows Insider, I tried the <a href="https://blogs.msdn.microsoft.com/wsl/2016/04/22/windows-subsystem-for-linux-overview/">Windows Subsystem for Linux</a> since day 1 and I really enjoyed it.</p><p>Now that Falls Creators Update is out, I&#39;m using the Ubuntu distro from the store, and the first thing I want to do is having the Docker client installed. It is not rocket science, but I did have some bumps on the road (because of my pretty low knowledge of Linux), so I thought I&#39;d write what I&#39;ve done to achieve that, in case it could be useful to somebody else.</p><p>There&#39;s something you need to understand first. The Docker Engine does not run on WSL, you HAVE to have Docker For Windows installed on your host machine. What we&#39;ll end up with at the end of this document is the Docker client running on Linux (WSL) sending commands to your Docker Engine daemon installed on Windows.</p><p>So, open you Ubuntu bash console, the first thing is to install the client. In order to do that you have to use apt-get, which is Ubuntu&#39;s package manager (more info about apt <a href="https://en.wikipedia.org/wiki/APT_(Debian)">here</a>).</p><ol><li>Update the apt package index:</li></ol><pre>$ sudo apt-get update</pre><p>2. Install packages to allow apt to use a repository over HTTPS:</p><pre>$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common</pre><p>3. Add Docker’s official GPG key:</p><pre>$ curl -fsSL <a href="https://download.docker.com/linux/ubuntu/gpg">https://download.docker.com/linux/ubuntu/gpg</a> | sudo apt-key add -</pre><p>Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.</p><pre>$ sudo apt-key fingerprint 0EBFCD88</pre><p><em>pub 4096R/0EBFCD88 2017–02–22<br> Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88<br>uid Docker Release (CE deb) &lt;docker@docker.com&gt;<br>sub 4096R/F273FCD8 2017–02–22</em></p><p>4. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands below.</p><pre>$ sudo add-apt-repository &quot;deb [arch=amd64] <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> $(lsb_release -cs) stable&quot;</pre><p>Now we&#39;re ready to install Docker Community Edition</p><p>5. Update the apt package index again</p><pre>$ sudo apt-get update</pre><p>6. And install Docker CE</p><pre>$ sudo apt-get install docker-ce</pre><p>When that finishes, you&#39;ll end up having everything installed in Linux, but as I mentioned before, the Docker Engine does not run in WSL so if you write any command like <em>docker images</em>, you&#39;ll see a message like this one:</p><blockquote>Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?</blockquote><p>No, it is not running and it&#39;ll never be, at least for now.</p><p>You need to tell the Docker client where the Docker host is, and you can do that by using the -H option as follows:</p><pre>$ docker -H localhost:2375 images</pre><p>If you don&#39;t want to type the host every time, you can set up and environment variable called DOCKER_HOST to localhost:2375</p><pre>$ export DOCKER_HOST=localhost:2375</pre><p>Now just running <em>docker images</em> will show the images in your host environment.</p><p>But, that environment variable will last only as long as the session does. You would have to set it every time you open bash. So, in order to avoid that, you set that variable in a file called .bash_profile in your home directory, like this:</p><pre>$ echo &quot;export DOCKER_HOST=localhost:2375&quot; &gt;&gt; ~/.bash_profile</pre><p>Restart the bash console and the DOCKER_HOST variable should be there, just type <em>docker images</em> to check everything is there.</p><p>I hope this post will help other, if it does, let me know.</p><p>EDIT: Make sure you expose the daemon on Windows, otherwise it won&#39;t work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*6XwT-oT7cbw63UFHLjQPzA.png" /></figure><p>References: <a href="https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/">Get Docker CE for Ubuntu</a></p><p>Special thanks to <a href="https://twitter.com/richturn_ms">Rich Turner</a> for his kindness and patience.</p><p><strong>EDIT</strong>: I recently learned there&#39;s an official, more complicated but secure, way of achieving the same, so I thought I&#39;d share it here: <a href="https://blogs.msdn.microsoft.com/commandline/2017/12/08/cross-post-wsl-interoperability-with-docker/">WSL Interoperability with Docker</a></p><p><strong>EDIT 2: </strong>As of June 12th 2019 WSL 2, has been released to Windows Insiders in the Fast Ring. WSL 2 is a whole new product, you can read more about it here (<a href="https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/">WSL 2 is now available Windows Insiders</a>). Keep in mind this post is only valid for what is now known as WSL 1 (the old, first, WSL release).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=612b392a44c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I’ve learnt from Docker]]></title>
            <link>https://medium.com/@sebagomez/what-ive-learnt-from-docker-2b29c876ee8d?source=rss-6f41b7faa0f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b29c876ee8d</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[genexus]]></category>
            <dc:creator><![CDATA[sebastian gomez]]></dc:creator>
            <pubDate>Fri, 30 Jun 2017 03:36:16 GMT</pubDate>
            <atom:updated>2018-06-10T02:15:17.168Z</atom:updated>
            <content:encoded><![CDATA[<p>This will be my first post of many more (I hope) to come. And there’s a simple reason to start blogging again. It was a great way of organizing ideas and things I’ve learnt in the past, plus, I get a lot of helpful tips from blogs around the web, so maybe this will help or at least bring some light in some subjects to others as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*QUJ3_WuLiQW4TEGna_S2Kg.jpeg" /></figure><p>So, why Docker? or maybe the better question would be, why now? Well, since I work building a Windows Forms-based product (<a href="https://medium.com/u/286a18d8cdee">GeneXus</a>) I wanted to start with Docker for Windows Containers, and Microsoft has now a decent amount of images for pretty much everything you might need.</p><p>But, what are containers? I’m going to give you the good definition and then my best interpretation of it. The good definition, or the best definition I found, does not come from Docker but from Amazon:</p><blockquote>Containers are a method of operating system virtualization that allow you to run an application and its dependencies in resource-isolated processes</blockquote><p><a href="https://aws.amazon.com/containers/">https://aws.amazon.com/containers/</a></p><p>My best interpretation of that is that you can think of a container like a box where your web app runs. But hey!, for my web app to run I need IIS (since it’s an asp.net site) and SQL Server because I need a database. Well, that also runs inside this container, and the good thing is, your system (including your registry) has no idea what you’re running in that container, and nothing from that container can see the host (unless to tell it so).</p><p>You probably saw that definition and read about containers and still don’t get what’s so special about it, “I have virtual machines where I get exactly that”, right? Well, yes, but imagine you are working on many projects at the same time. You might need to have the NodeJS environment for some project, maybe Python for another one, and maybe Ruby. What about your local IIS? how many different websites or apps do you have there? And what about your local SQL Server? how many databases do you have there? How many versions do you have on your machine? what if you get a brand new MDF from a client who is working on a version you still don’t have? How long does it take for you to find the right installer, run it, and have that MDF attached to your newly installed SQL Server, and be ready to start debugging?</p><p>That’s exactly why containers are so great for developers, plus (big plus), if you have a working image where you reproduced a bug, you can bring that image to a coworker and he’ll have that exact environment running on his machine, reproducing that very same bug. How cool is that?</p><p>I’m not going to write how to do all that, there tons of posts about how to do that. <a href="http://docker.com/">Docker.com</a> has a great <a href="https://docs.docker.com/">documentation </a>site, for both Docker and the <a href="https://docs.docker.com/docker-for-windows/">Docker for Windows</a> client. Also, Microsoft has some good documentation around its <a href="https://docs.microsoft.com/en-us/virtualization/windowscontainers/about/">Windows Containers</a>.</p><p>Okay, but the title of this story is “What I’ve learned” so, what did I learn? I learned a lot of stuff on how to work with it, how to create images, containers, compose files and many other things you can learn online in the links above. But I also learn that this kind of technology is here to stay. I’m not saying Docker will stay forever, but this way of running application no matter where they were built and what were the needs for that build, is a great way of bringing developers together. And probably be able to share more code, not source files, that’s what GitHub is for, but running bits, without the need of a special makefile, environment variables and tons of other stuff I will not have in my environment.</p><p>This cool technology has a down side though, I won’t be able to use Joel’s <a href="https://blog.codinghorror.com/the-works-on-my-machine-certification-program/">“works on my machine”</a> badge from now on ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/124/1*uTc5zgDQRKy9rftDg-vh1g.png" /></figure><p>EDIT: Here’ something new I learned after I published this article. There’s this site called <a href="https://www.fromlatest.io/">fromlatest.io</a> which helps you minimize your build process making your Dockerfile “friendlier” to the Docker engine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b29c876ee8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>