<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jonathan Walter</title>
    <description>The latest articles on DEV Community by Jonathan Walter (@jonathanwalter).</description>
    <link>https://dev.to/jonathanwalter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F580098%2F40aedf64-16e2-4071-86d3-689604f35d87.jpeg</url>
      <title>DEV Community: Jonathan Walter</title>
      <link>https://dev.to/jonathanwalter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jonathanwalter"/>
    <language>en</language>
    <item>
      <title>Deploy your containers to AWS or Azure in under 10 minutes (no, really!)</title>
      <dc:creator>Jonathan Walter</dc:creator>
      <pubDate>Fri, 28 May 2021 12:57:16 +0000</pubDate>
      <link>https://dev.to/video/deploy-your-containers-to-aws-or-azure-in-under-10-minutes-no-really-2anh</link>
      <guid>https://dev.to/video/deploy-your-containers-to-aws-or-azure-in-under-10-minutes-no-really-2anh</guid>
      <description>&lt;p&gt;Did you know you can deploy your existing docker-compose stack to AWS Elastic Container Service or Azure Container Instance using the docker command? Yeah, me neither.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get the CLI
&lt;/h2&gt;

&lt;p&gt;There is a tech preview of the docker CLI that includes the &lt;code&gt;compose&lt;/code&gt; command. This is mostly compatible with the earlier &lt;code&gt;docker-compose&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The tech preview is included in Docker Desktop for Mac and Windows 3.2.1 and above, but if you want to run it on Linux you'll have to install it yourself:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Docker CLI tech preview linux install
curl -L https://raw.githubusercontent.com/docker/compose-cli/main/scripts/install/install_linux.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Create context
&lt;/h2&gt;

&lt;p&gt;To manage our cloud deployments we'll have to set up a new &lt;a href="https://docs.docker.com/engine/context/working-with-contexts/"&gt;docker context&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Using AWS
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker context create ecs some-name-here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can use your AWS credentials in one of three ways. If you alreade have the AWS CLI configured, you can use your credentials from there. Otherwise you can input them when asked or use environment variables. Make sure your IAM role has the &lt;a href="https://docs.docker.com/cloud/ecs-integration/#requirements"&gt;correct premissions&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;? Create a Docker context using:  [Use arrows to move, type to filter]
&amp;gt; An existing AWS profile
AWS secret and token credentials
AWS environment variables
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Using Azure
&lt;/h3&gt;

&lt;p&gt;The procedure for Azure is a little bit different. You must first tell docker to log in to Azure:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker login azure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will open a web page where you enter your credentials, or fall back to using the Azure device code flow. Note that this is separate from the Azure CLI login.&lt;/p&gt;

&lt;p&gt;This can be done without interaction as well, which is handy for CI workflows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker login azure --client-id xx --client-secret yy --tenant-id zz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can use the &lt;code&gt;--tenant-id&lt;/code&gt; option alone to specify a tenant, if you have multiple ones.&lt;/p&gt;

&lt;p&gt;To create the actual docker context we run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker context create aci some-name-here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will let you pick a resource group to use, or create a new one. Again, to run this without interaction we can specify &lt;code&gt;--subscription-id&lt;/code&gt;, -&lt;code&gt;-resource-group&lt;/code&gt;, and &lt;code&gt;--location&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Activate your context
&lt;/h2&gt;

&lt;p&gt;Once your context is created you can view it by running &lt;code&gt;docker context ls&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To activate the context run:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker context use some-name-here&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Deploy your stack&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Now that we have the basics covered, we are ready to deploy stuff!&lt;/p&gt;

&lt;p&gt;It is almost too simple, just run &lt;code&gt;docker compose up&lt;/code&gt; as you normally would. Docker will automagically create all necessary resources in AWS or Azure and deploy your container(s). Similarly, &lt;code&gt;docker compose down&lt;/code&gt; will remove everything.&lt;/p&gt;

&lt;h2&gt;
  
  
  But I want to do more advanced things!
&lt;/h2&gt;

&lt;p&gt;Fret not. The Docker CLI has support for many more things, such as volumes, secrets, auto scaling, DNS labels, health checks and so on... &lt;/p&gt;

&lt;p&gt;I highly recommend you read the official documentation/guides for &lt;a href="https://docs.docker.com/cloud/ecs-integration/"&gt;AWS&lt;/a&gt; and &lt;a href="https://docs.docker.com/cloud/aci-integration/"&gt;Azure&lt;/a&gt; deployment. But that will probably take more than 10 minutes.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Jonathan Walter is a Media Consultant at Eyevinn Tecnology, the European leading independent consultancy firm specializing in video technology and media distribution.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Image is a montage of photos by &lt;a href="https://unsplash.com/@pericakalimerica?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Pero Kalimero&lt;/a&gt; and &lt;a href="https://unsplash.com/@toddcravens?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Todd Cravens&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>aws</category>
      <category>azure</category>
      <category>cloud</category>
    </item>
    <item>
      <title>asdf - the final(?) version manager</title>
      <dc:creator>Jonathan Walter</dc:creator>
      <pubDate>Mon, 26 Apr 2021 12:43:21 +0000</pubDate>
      <link>https://dev.to/video/asdf-the-final-version-manager-19am</link>
      <guid>https://dev.to/video/asdf-the-final-version-manager-19am</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Have you ever had the need to run multiple different versions of Nodejs? -Of course, silly! We have &lt;a href="https://github.com/nvm-sh/nvm"&gt;nvm&lt;/a&gt; for that. &lt;/p&gt;

&lt;p&gt;How about python, then? -Yeah, we use &lt;a href="https://github.com/pyenv/pyenv"&gt;pyenv&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Java? -Yup. &lt;a href="https://sdkman.io/"&gt;SDKman&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Ruby? -&lt;a href="https://rvm.io/"&gt;rvm&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Tmux? -Um...&lt;/p&gt;

&lt;p&gt;Vim? -But why?!&lt;/p&gt;

&lt;p&gt;If you are (or pretending to be) a polyglot software developer, you'll need a whole lot of versioning managers and a whole lot of different commands and syntax to remember. &lt;/p&gt;

&lt;p&gt;Wouldn't it be nice if there was one tool that could handle everything? There is - &lt;a href="https://github.com/asdf-vm/asdf"&gt;asdf&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;asdf&lt;/code&gt; is available on both macOS and Linux. The examples in this article will use macOS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dependencies
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;asdf&lt;/code&gt; requires you to have &lt;code&gt;corutils&lt;/code&gt;, &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;git&lt;/code&gt; installed. We can install them using Homebrew:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install coreutils curl git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We'll install &lt;code&gt;asdf&lt;/code&gt; itself with Homebrew too:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install asdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next we need to add &lt;code&gt;asdf.sh&lt;/code&gt; to our &lt;code&gt;.zshrc&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo -e "\n. $(brew --prefix asdf)/asdf.sh" &amp;gt;&amp;gt; ${ZDOTDIR:-~}/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;(if you're using &lt;a href="https://ohmyz.sh/"&gt;oh-my-zsh&lt;/a&gt; there is a &lt;a href="https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf"&gt;plugin for asdf&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Now we're ready to start using it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started with &lt;code&gt;asdf&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;These are the basic principles for using &lt;code&gt;asdf&lt;/code&gt;. Be sure to check out the &lt;a href="https://asdf-vm.com/"&gt;official documentation&lt;/a&gt; as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding plugins and versions
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;asdf&lt;/code&gt; has a &lt;a href="https://asdf-vm.com/#/plugins-all"&gt;long list&lt;/a&gt; of plugins for different languages and tools.&lt;/p&gt;

&lt;p&gt;To add python we simply execute:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf plugin add python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;asdf&lt;/code&gt; is now python-aware, and we can install multiple versions of it. &lt;/p&gt;

&lt;p&gt;To get the latest one (3.9.4 when I wrote this):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf install python latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To get a specific version:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf install python 3.8.7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Setting versions
&lt;/h3&gt;

&lt;p&gt;Now that we have a couple of versions of Python installed we should set the default global version:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf global python 3.9.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We can also set the global version to the operating systems version of python (not managed by asdf):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf global python system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To set a version to be used in the current directory (and any sub-directories) we run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf local python 3.8.7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We can even set a specific version for the current shell:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf shell python 3.8.7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Finding out what versions are active is as simple as running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf current
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The &lt;code&gt;.tool-versions&lt;/code&gt; file
&lt;/h3&gt;

&lt;p&gt;To keep track of what versions to use, &lt;code&gt;asdf&lt;/code&gt; creates a &lt;code&gt;.tool-versions&lt;/code&gt; file. For global settings this will be located at &lt;code&gt;$HOME/.tool-versions&lt;/code&gt; and for local versions it'll be put in your current directory.&lt;/p&gt;

&lt;p&gt;This is just a text file describing what versions to use and it can look something like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nodejs 16.0.0
python 3.9.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It is also possible to have several versions defined:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python 3.9.4 3.8.7 system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Coming from other version managers
&lt;/h2&gt;

&lt;p&gt;"I already use &lt;code&gt;nvm&lt;/code&gt; and &lt;code&gt;pyenv&lt;/code&gt;, and have a million &lt;code&gt;.nvmrc&lt;/code&gt;, &lt;code&gt;.node-version&lt;/code&gt; and &lt;code&gt;.python-version&lt;/code&gt; files sprinkled through-out my system!", you might say. &lt;code&gt;asdf&lt;/code&gt; can take advantage of these files if we tell it to.&lt;/p&gt;

&lt;p&gt;We need to create a file in your home directory called &lt;code&gt;.asdfrc&lt;/code&gt; with the following content:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;legacy_version_file = yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will enable support for reading version files used by other version managers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;That is pretty much all there is to it. It is &lt;em&gt;super&lt;/em&gt; handy to just &lt;code&gt;cd&lt;/code&gt; into a directory and have &lt;code&gt;asdf&lt;/code&gt; automatically switch to the correct version of the tools needed for that particular project.&lt;/p&gt;

&lt;p&gt;It also integrates very nicely with &lt;a href="https://ohmyz.sh/"&gt;oh-my-zsh&lt;/a&gt; and &lt;a href="https://github.com/romkatv/powerlevel10k"&gt;powerline10k&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--32P6c-Kv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4v5543oxp2hpyz31jed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--32P6c-Kv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4v5543oxp2hpyz31jed.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Jonathan Walter is a Media Consultant at &lt;a href="https://www.eyevinn.se/"&gt;Eyevinn Tecnology&lt;/a&gt;, the European leading independent consultancy firm specializing in video technology and media distribution.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@scottwebb?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Scott Webb&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tooling</category>
    </item>
  </channel>
</rss>
