<?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: Mahesh Jagtap</title>
    <description>The latest articles on DEV Community by Mahesh Jagtap (@jagtapmv).</description>
    <link>https://dev.to/jagtapmv</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%2F348269%2F6ef59f19-e10a-4162-9d74-4901326d9d80.jpeg</url>
      <title>DEV Community: Mahesh Jagtap</title>
      <link>https://dev.to/jagtapmv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jagtapmv"/>
    <language>en</language>
    <item>
      <title>Upgrade Go version on Linux mint</title>
      <dc:creator>Mahesh Jagtap</dc:creator>
      <pubDate>Tue, 26 Jul 2022 14:11:31 +0000</pubDate>
      <link>https://dev.to/jagtapmv/upgrade-go-version-on-linux-mint-5aed</link>
      <guid>https://dev.to/jagtapmv/upgrade-go-version-on-linux-mint-5aed</guid>
      <description>&lt;p&gt;I was using Go version 1.13.8 which is latest if you install it using "apt-get install golang-go" command on linux mint or ubuntu.&lt;/p&gt;

&lt;p&gt;Now I wanted to use generics and kafka-go package, which is not available for Go version less that 1.18 and 1.15 respectively.&lt;/p&gt;

&lt;p&gt;So I decided to upgrade the Go version. But as I surf through the internet, I was not able to find a concrete solution for this.&lt;/p&gt;

&lt;p&gt;So after much surfing and trial and error, here is the procedure I followed:&lt;br&gt;
If you have installed the Go using above method, then:&lt;br&gt;
first remove the older version using:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get remove golang-go&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get remove --auto-remove golang-go&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above command must have uninstall the older version of Go from your system. Check it using &lt;code&gt;go version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now,If it is present, delete the go folder from usr/local.&lt;/p&gt;

&lt;p&gt;After that, get the latest version file of Go for Linux(It was 1.18.4 at the time of writing this blog) using:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget https://go.dev/dl/go1.18.4.linux-amd64.tar.gz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Manually untar it or use tar command as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tar -xvf go1.18.4.linux-amd64.tar.gz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and move it to usr/local, manually using "Files" or using command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv go /usr/local&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now this has been taken care of, we have to define the GOROOT, GOPATH and PATH variables in profile file. For system wide permanent effect copy following three lines and paste them into /etc/profile file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export GOROOT=/usr/local/go
export GOPATH=$HOME/&amp;lt;path to where your all go projects lies&amp;gt;
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR, if you want the changes for that particular session, you can run above "export" commands in your terminal.&lt;/p&gt;

&lt;p&gt;Now check go version, it should show you the one you installed.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>go</category>
      <category>upgrade</category>
      <category>linux</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Solution for "error: connect econnrefused [container_ip]:3306"</title>
      <dc:creator>Mahesh Jagtap</dc:creator>
      <pubDate>Thu, 23 Apr 2020 15:21:01 +0000</pubDate>
      <link>https://dev.to/jagtapmv/solution-for-error-connect-econnrefused-containerip-3306-407n</link>
      <guid>https://dev.to/jagtapmv/solution-for-error-connect-econnrefused-containerip-3306-407n</guid>
      <description>&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;There are many more reasons for this error. In some, users had used wrong port for MySQL in node application, in others 3306 port was already in use etc.&lt;/p&gt;

&lt;p&gt;But for me, it was "docker-compose.yml" file issue. FYI, I am using 3 different containers for React, Node, and MySQL.&lt;/p&gt;

&lt;p&gt;The issue was that, I was using "image" in docker-compose file for database service like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8E2BAN_x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/isx92wo6d0denyo590iu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8E2BAN_x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/isx92wo6d0denyo590iu.png" alt="docker-compose_OLD"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was all right, untill I used volumes in dbservice. But after using volumes in dbservice it throws the above error.&lt;/p&gt;

&lt;p&gt;The solution was to modify the docker-compose file like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KBG5yNzW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7992d3ysr8fhusq3udi3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBG5yNzW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7992d3ysr8fhusq3udi3.png" alt="docker-compose_Updated"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and then adding following to Dockerfile:&lt;/p&gt;

&lt;p&gt;//Dockerfile start&lt;br&gt;
FROM mysql&lt;br&gt;
//Dockerfile end&lt;/p&gt;

&lt;p&gt;I hope you understood the solution. If have any queries, please feel free to ask it in a comment section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank You.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>solution</category>
      <category>node</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Docker Basics - Part I</title>
      <dc:creator>Mahesh Jagtap</dc:creator>
      <pubDate>Sun, 05 Apr 2020 12:28:36 +0000</pubDate>
      <link>https://dev.to/jagtapmv/docker-basics-part-i-pp7</link>
      <guid>https://dev.to/jagtapmv/docker-basics-part-i-pp7</guid>
      <description>&lt;p&gt;&lt;em&gt;Before starting, I assume that you know the following topics:&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;What is Docker?&lt;/strong&gt; &lt;em&gt;(Its a Containerization Technology.)&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;What is Containerization?&lt;/strong&gt; &lt;em&gt;(It is a virtualization method that uses single OS to power multiple distributed application.)&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Why to use Docker?&lt;/strong&gt; &lt;em&gt;(So that we can manage dependencies and configuration needed for different application.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you understand above points, then you are ready to go with Docker commands; else, please check the following link:&lt;/em&gt; &lt;a href="https://opensource.com/resources/what-docker"&gt;What is Docker?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For installation of docker please refer this article: &lt;a href="https://docs.docker.com/docker-for-mac/install/"&gt;Mac&lt;/a&gt;  &lt;a href="https://docs.docker.com/docker-for-windows/install/"&gt;Windows&lt;/a&gt;  &lt;a href="https://runnable.com/docker/install-docker-on-linux"&gt;Linux&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Docker Commands&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now, let's run through the docker commands using question-answer paradigm for easy understanding.&lt;br&gt;
&lt;strong&gt;1 What should be our first command?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A: We should Check if the docker service is up and running. For starting docker service in Linux, use:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ service docker start&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2 Now, the service has started, so can we create a container now?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A: Yes, indeed! For creating container, you will need an image. you can search the required image at &lt;a href="https://hub.docker.com/"&gt;dockerhub&lt;/a&gt;. In this tutorial, we are using "busybox" image. So, in search box type 'busybox'. The first result will be official image. Click on that image, you will see tags section there. For this we will be using '1.31' as a tag. So, the structure of our command would be like:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker run [Image Name]:[Tag]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For our example, it would be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker run busybox:1.31&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3 Is our container ready? If yes, how can we validate that?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A: Yes, our container is ready and we can validate that using following command:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker ps -a&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What it will do is, it will print all the container that we created till now. In your case it will be only one and that is created from busybox image. Now in output you will get dome info about your newly created container like container ID, Image used, is container up and running or not? etc.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4 So, whats next we created a container, but can we know more about our container like, what is IP and other stuff?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A: Yes, we can see that using following command. It will be of prime importance when we will be using environmental variables, networking and Volumes:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker inspect [container ID]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What are you asking, where can we get this [container ID]? Yes, I here you, You can get it from the output of command from 3rd question. see, its the first field. Just copy and paste that ID in this command.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5 Enough about containers,how can I check if the image is locally present or not?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A: Yes, you can check that with following command:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker images&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6 OK, that's good. But what if I want to assign a port to the container or give name of my choice?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A: You can do that too. This can be done by passing the so called arguments to the "docker run" command. Let's have some light on that too. The first argument we want to know about is detach mode of container. With this you don't have to stay on that particular container and still your container will be up and running in background. The argument you pass to the 'docker run' command is "-d". Let's have an example:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker run -d busybox:1.31&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can also assign a destination port to your container like this:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker run -p [dest_port]:[source_port] [image]:[tag]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can also give specific name to your container with --name argument, like:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker run --name bbapp busybox:1.31&lt;/strong&gt; &lt;em&gt;//now your container name is bbapp.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can also start your container in an interactive mode with -it tag. Have a try:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker run -it busybox:1.31&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;7 Last but not least, when there will be much more containers to handle, we will need to remove some containers. we can do that with following command:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;dokcer rm [container1_id/name]....[containern_id/name]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ docker rm bbapp&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;Conclusion: Okay, that's it for this article. In next article we will start with how to create our own images by using images from docker hub: With and without &lt;a href="https://docs.docker.com/engine/reference/builder/"&gt;dockerfile&lt;/a&gt;. Thanks for a read.&lt;/em&gt;
&lt;/h4&gt;

</description>
      <category>docker</category>
      <category>tutorial</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
