<?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: Rajnish</title>
    <description>The latest articles on DEV Community by Rajnish (@rajnishspandey).</description>
    <link>https://dev.to/rajnishspandey</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%2F2286428%2F1e7927da-23f0-4ad3-954c-b2bb5453284c.png</url>
      <title>DEV Community: Rajnish</title>
      <link>https://dev.to/rajnishspandey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajnishspandey"/>
    <language>en</language>
    <item>
      <title>Databricks introduction</title>
      <dc:creator>Rajnish</dc:creator>
      <pubDate>Mon, 11 Nov 2024 17:29:00 +0000</pubDate>
      <link>https://dev.to/rajnishspandey/databricks-introduction-2a4i</link>
      <guid>https://dev.to/rajnishspandey/databricks-introduction-2a4i</guid>
      <description>&lt;h2&gt;
  
  
  Databricks
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;it is a unified, open analytics platform for building, deploying, sharing and maintaining data, analytics, and AI solutions at scale.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzvei02zf34w7ht0cvz6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzvei02zf34w7ht0cvz6.png" alt="Databricks Architecture and Services" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Clusters
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;it’s a collection of VM (Virtual Machines) instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;over which computational workloads are distributed across workers&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvy0crwq5s53nor3j6l5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvy0crwq5s53nor3j6l5.png" alt="Comparison" width="800" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are two types&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;All-Purpose Clusters&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Job Clusters&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Analyse data collectively using interactive Notebooks&lt;/td&gt;
&lt;td&gt;Run automated jobs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create cluster from the workspace or API&lt;/td&gt;
&lt;td&gt;The Databricks job scheduler creates job clusters when running jobs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration information is retained for upto 70 clusters for upto 30 days&lt;/td&gt;
&lt;td&gt;Configuration information is retained for upto 30 most recently terminated cluster&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>databrick</category>
    </item>
    <item>
      <title>Share docker image on docker hub</title>
      <dc:creator>Rajnish</dc:creator>
      <pubDate>Sat, 02 Nov 2024 13:41:49 +0000</pubDate>
      <link>https://dev.to/rajnishspandey/share-docker-image-on-docker-hub-2d6h</link>
      <guid>https://dev.to/rajnishspandey/share-docker-image-on-docker-hub-2d6h</guid>
      <description>&lt;p&gt;If you are new to docker and want to learn everything of docker read this blog &lt;a href="https://dev.to/rajnishspandey/from-setup-to-deployment-running-a-flask-app-in-docker-on-mac-2fpp"&gt;From Setup to Deployment: Running a Flask App in Docker on Mac&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have created another blog to &lt;a href="https://dev.to/rajnishspandey/deploy-flask-app-using-docker-compose-4i81"&gt;Deploy Flask app using docker Compose&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's start this blog&lt;br&gt;
we are going to share an image on docker hub and then we will validate it with pull request on our local machine.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker hub&lt;/a&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Docker hub is a platform where we can publish our own docker image and we can use existing images vice versa.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;steps to be followed&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;register or login on docker hub&lt;/li&gt;
&lt;li&gt;Create a new repository&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqjdnr8oh0hqeujuj1bi4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqjdnr8oh0hqeujuj1bi4.png" alt="register or login on docker hub" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Create repository and the fill up the details I have given the repository name as &lt;code&gt;productivity-docker&lt;/code&gt; once repository is created copy and save the command from docker-hub for your repository&lt;/p&gt;

&lt;p&gt;example for me it's - &lt;code&gt;docker push rajnishspandey/productivity-docker&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;now run let's get back to our Terminal or vscode whatever editor you are using.&lt;/p&gt;

&lt;p&gt;To create new image &lt;strong&gt;&lt;em&gt;make sure you have dockerfile&lt;/em&gt;&lt;/strong&gt; in your project repository or you are in correct directory&lt;/p&gt;

&lt;p&gt;run in Terminal (creating image again as I have deleted all the images)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;docker build -t rajnishspandey/productivity-docker .&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzodarlaq9qb91t5ttus9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzodarlaq9qb91t5ttus9.png" alt="docker image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;docker login&lt;/code&gt; run it in terminal if you are already logged in to &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;docker-hub&lt;/a&gt; it will authenticate if not just provide your credentials in Terminal and get authenticated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;now run the command we have saved above from docker hub repository in Terminal &lt;code&gt;docker push rajnishspandey/productivity-docker&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will check our image and latest tag of the docker image and if found it will publish the image to docker-hub&lt;/p&gt;

&lt;p&gt;Now let's check the image in docker-hub&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vbn8xfn405mtz6r27x4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vbn8xfn405mtz6r27x4.png" alt="rajnishspandey/productivity-docker" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Validation&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;let's validate with the pull request of our &lt;a href="https://hub.docker.com/r/rajnishspandey/productivity-docker" rel="noopener noreferrer"&gt;latest image&lt;/a&gt; from docker-hub&lt;/p&gt;

&lt;p&gt;but before doing pull first will delete all the images from our local docker desktop app to make sure we don't have any image before pull.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ru1gmsa8ftj4w1u5bus.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ru1gmsa8ftj4w1u5bus.png" alt="Image deleted" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;now run pull request&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;docker pull rajnishspandey/productivity-docker&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2wsnezdrcdqj641ustpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2wsnezdrcdqj641ustpw.png" alt="Image created" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create container and run the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1wprffkt2kzicmxjnocj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1wprffkt2kzicmxjnocj.png" alt="container created" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn how to
&lt;/h3&gt;

&lt;h4&gt;
  
  
  - &lt;a href="https://dev.to/rajnishspandey/from-setup-to-deployment-running-a-flask-app-in-docker-on-mac-2fpp"&gt;From Setup to Deployment: Running a Flask App in Docker&lt;/a&gt;
&lt;/h4&gt;

&lt;h4&gt;
  
  
  - &lt;a href="https://dev.to/rajnishspandey/deploy-flask-app-using-docker-compose-4i81"&gt;Deploy Flask app using docker Compose&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;"Happy Learning"&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://rajnishspandey.gumroad.com/coffee" rel="noopener noreferrer"&gt;Buy me a coffee&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  some useful docker commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker images&lt;/code&gt; to check all the images &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker build -t &amp;lt;new-image-name&amp;gt;-app .&lt;/code&gt; to build an images from your application&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker image rm &amp;lt;image-name&amp;gt;&lt;/code&gt; - to delete image which is not in use&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker run -it --name &amp;lt;new_container&amp;gt; &amp;lt;base-image&amp;gt; /bin/bash&lt;/code&gt; to create a new container and run it from base image. (here above we had python as base image)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker image rm &amp;lt;image-name&amp;gt; -f&lt;/code&gt; delete image which is in use forcefully&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker ps -a&lt;/code&gt; to see all the containers running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker container rm &amp;lt;container-name&amp;gt;&lt;/code&gt; to delete container which is not running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker container rm &amp;lt;container-name&amp;gt; -f&lt;/code&gt; to delete container forcefully which is running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker system prune -a&lt;/code&gt; to delete all containers, images and caches.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker compose up&lt;/code&gt; to run docker compose file and created image&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker pull rajnishspandey/productivity-docker&lt;/code&gt; to pull the latest image from docker-hub&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker push rajnishspandey/productivity-docker&lt;/code&gt; - to push the latest image on docker-hub&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker login&lt;/code&gt; - to login on docker-hub through terminal&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>docker</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Deploy Flask app using docker Compose</title>
      <dc:creator>Rajnish</dc:creator>
      <pubDate>Sat, 02 Nov 2024 12:19:22 +0000</pubDate>
      <link>https://dev.to/rajnishspandey/deploy-flask-app-using-docker-compose-4i81</link>
      <guid>https://dev.to/rajnishspandey/deploy-flask-app-using-docker-compose-4i81</guid>
      <description>&lt;h3&gt;
  
  
  &lt;a href="https://docs.docker.com/compose/" rel="noopener noreferrer"&gt;Docker compose&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Compose simplifies the control of your entire application stack, making it easy to manage services, networks, and volumes in a single, comprehensible YAML configuration file. Then, with a single command, you create and start all the services from your configuration file&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  To learn more about Docker images, containers and basic Flask app deployment on docker &lt;a href="https://dev.to/rajnishspandey/from-setup-to-deployment-running-a-flask-app-in-docker-on-mac-2fpp"&gt;read blog&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;In this blog we are going to deploy our &lt;a href="https://github.com/rajnishspandey/productivity.git" rel="noopener noreferrer"&gt;flask application&lt;/a&gt; on Docker using docker compose file.&lt;/p&gt;

&lt;p&gt;how to clone, create, deploy everything is already covered &lt;a href="https://dev.to/rajnishspandey/from-setup-to-deployment-running-a-flask-app-in-docker-on-mac-2fpp"&gt;here&lt;/a&gt; please read and follow the instructions or you can just start by &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;git clone https://github.com/rajnishspandey/productivity.git&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker system prune -a&lt;/code&gt; to delete all existing containers, images and caches.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;docker compose up&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Docker Images&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffysvvwijxavcn6tkq32e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffysvvwijxavcn6tkq32e.png" alt="Docker Images" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Docker Containers&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk7nyww2vgq4obssju9ei.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk7nyww2vgq4obssju9ei.png" alt="Docker Containers" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Running flask Application&lt;br&gt;
&lt;strong&gt;&lt;em&gt;This UI can be different as it's possible that the code is updated&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxaqsqctbqg93hsafe67b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxaqsqctbqg93hsafe67b.png" alt="Running Application" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn how to
&lt;/h3&gt;

&lt;h4&gt;
  
  
  - &lt;a href="https://dev.to/rajnishspandey/from-setup-to-deployment-running-a-flask-app-in-docker-on-mac-2fpp"&gt;From Setup to Deployment: Running a Flask App in Docker&lt;/a&gt;
&lt;/h4&gt;

&lt;h4&gt;
  
  
  - &lt;a href="https://dev.to/rajnishspandey/share-docker-image-on-docker-hub-2d6h"&gt;Share docker image on docker hub&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;"Happy Learning"&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://rajnishspandey.gumroad.com/coffee" rel="noopener noreferrer"&gt;Buy me a coffee&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  some useful docker commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker images&lt;/code&gt; to check all the images &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker build -t &amp;lt;new-image-name&amp;gt;-app .&lt;/code&gt; to build an images from your application&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker image rm &amp;lt;image-name&amp;gt;&lt;/code&gt; - to delete image which is not in use&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker run -it --name &amp;lt;new_container&amp;gt; &amp;lt;base-image&amp;gt; /bin/bash&lt;/code&gt; to create a new container and run it from base image. (here above we had python as base image)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker image rm &amp;lt;image-name&amp;gt; -f&lt;/code&gt; delete image which is in use forcefully&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker ps -a&lt;/code&gt; to see all the containers running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker container rm &amp;lt;container-name&amp;gt;&lt;/code&gt; to delete container which is not running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker container rm &amp;lt;container-name&amp;gt; -f&lt;/code&gt; to delete container forcefully which is running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker system prune -a&lt;/code&gt; to delete all containers, images and caches.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker compose up&lt;/code&gt; to run docker compose file and created image&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>docker</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>From Setup to Deployment: Running a Flask App in Docker on Mac</title>
      <dc:creator>Rajnish</dc:creator>
      <pubDate>Sat, 02 Nov 2024 10:26:40 +0000</pubDate>
      <link>https://dev.to/rajnishspandey/from-setup-to-deployment-running-a-flask-app-in-docker-on-mac-2fpp</link>
      <guid>https://dev.to/rajnishspandey/from-setup-to-deployment-running-a-flask-app-in-docker-on-mac-2fpp</guid>
      <description>&lt;h3&gt;
  
  
  &lt;a href="https://www.docker.com/products/docker-desktop/" rel="noopener noreferrer"&gt;Download Docker&lt;/a&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Docker Images
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Docker Images are the templates (blueprint) of the project&lt;/li&gt;
&lt;li&gt;Images can not be updated it's read-only&lt;/li&gt;
&lt;li&gt;It has Source code, Libraries, external dependencies, tools etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Docker Containers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Containers are the running instance of the Image&lt;/li&gt;
&lt;li&gt;It runs independently on computer hence we can call it, it's an isolated process&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Docker base Image or Parent Image
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Example Python programming image which we can download from official website of &lt;a href="https://hub.docker.com/_/python" rel="noopener noreferrer"&gt;Docker hub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  How do we create Docker image
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;To create a Docker image, we write the details in a Dockerfile that contains instructions for building the image. When we build this Dockerfile, an image is generated, which we can then run as a container.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's proceed with setup and run&lt;br&gt;
After downloading docker desktop&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;search Python base image in docker hub pull it using Terminal or Docker Desktop&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;run using Terminal or Docker Desktop&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;docker run -it --name rajnish_python python /bin/bash&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27zk9do09ib5kk20tb67.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27zk9do09ib5kk20tb67.png" alt="rajnish_python container" width="800" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;now go to Container in docker desktop and see if it's running.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Container and explore it more by checking python version&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5no8zxyca673mgu6c6am.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5no8zxyca673mgu6c6am.png" alt="Docker container explore" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  let's create a basic Python Flask web-app and run it through docker
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;either you can create a new web app or just clone my repository &lt;a href="https://github.com/rajnishspandey/productivity.git" rel="noopener noreferrer"&gt;productivity&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;git clone https://github.com/rajnishspandey/productivity.git&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Here I have created a project and it's in my local I want to create a new repository on github and push it from my Terminal&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;del&gt;&lt;strong&gt;&lt;em&gt;in case you want to remove the git initialised you can run below command and do git init again to add.&lt;/em&gt;&lt;/strong&gt;&lt;/del&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;del&gt;&lt;strong&gt;&lt;em&gt;rm -rf git&lt;/em&gt;&lt;/strong&gt;&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m 'Initial Commit'&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;I created a repository called productivity on github and will link it with my local/remote git&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;git remote set-url origin https://github.com/rajnishspandey/productivity.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -u origin master&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;now let's build the app and copy all the files of our application to our container
&amp;gt; &lt;code&gt;docker build -t productivity-app .&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgyjdg7arzfeo9vi8nagv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgyjdg7arzfeo9vi8nagv.png" alt="build" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;command to check how many images we have in docker&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
run &lt;code&gt;docker images&lt;/code&gt; in Terminal&lt;/p&gt;

&lt;p&gt;we can see now new images is created in the docker&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwnpyn83h9hyftjenuivh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwnpyn83h9hyftjenuivh.png" alt="Docker New Images" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have to run it through container&lt;/p&gt;

&lt;h2&gt;
  
  
  Click on run and configure the details
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19fgom9h573egyvmt3w2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19fgom9h573egyvmt3w2.png" alt="images port assignment" width="800" height="924"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;click on ports 5500:5000
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbyya77g24o6uwmacln95.png" alt="running container" width="800" height="284"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;it will redirect you to the browser and you should see the app running&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;This UI can be different as it's possible that the code is updated&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqz3bq5fcgatlywx9a6y3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqz3bq5fcgatlywx9a6y3.png" alt="output" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://docs.docker.com/reference/cli/docker/" rel="noopener noreferrer"&gt;Docker Command list from official site&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Learn how to
&lt;/h3&gt;

&lt;h4&gt;
  
  
  - &lt;a href="https://dev.to/rajnishspandey/share-docker-image-on-docker-hub-2d6h"&gt;Share docker image on docker hub&lt;/a&gt;
&lt;/h4&gt;

&lt;h4&gt;
  
  
  - &lt;a href="https://dev.to/rajnishspandey/deploy-flask-app-using-docker-compose-4i81"&gt;Deploy Flask app using docker Compose&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;"Happy Learning"&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://rajnishspandey.gumroad.com/coffee" rel="noopener noreferrer"&gt;Buy me a coffee&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  some useful docker commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker images&lt;/code&gt; to check all the images &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker build -t &amp;lt;new-image-name&amp;gt;-app .&lt;/code&gt; to build an images from your application&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker image rm &amp;lt;image-name&amp;gt;&lt;/code&gt; - to delete image which is not in use&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker run -it --name &amp;lt;new_container&amp;gt; &amp;lt;base-image&amp;gt; /bin/bash&lt;/code&gt; to create a new container and run it from base image. (here above we had python as base image)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker image rm &amp;lt;image-name&amp;gt; -f&lt;/code&gt; delete image which is in use forcefully&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker ps -a&lt;/code&gt; to see all the containers running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker container rm &amp;lt;container-name&amp;gt;&lt;/code&gt; to delete container which is not running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker container rm &amp;lt;container-name&amp;gt; -f&lt;/code&gt; to delete container forcefully which is running&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker system prune -a&lt;/code&gt; to delete all containers, images and caches.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>docker</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Share files-Photos between Mac and GooglePixel</title>
      <dc:creator>Rajnish</dc:creator>
      <pubDate>Sun, 27 Oct 2024 14:12:15 +0000</pubDate>
      <link>https://dev.to/rajnishspandey/share-files-photos-between-mac-and-googlepixel-14mn</link>
      <guid>https://dev.to/rajnishspandey/share-files-photos-between-mac-and-googlepixel-14mn</guid>
      <description>&lt;p&gt;I have always been annoyed by the hassle of moving files between my Mac and Google Pixel (6A). I was looking for a reliable, safe, and fast tool that doesn't cost me anything.&lt;/p&gt;

&lt;p&gt;After some research, I found a tool that exceeded my expectations in terms of speed and efficiency.&lt;/p&gt;

&lt;p&gt;Here is how I set it up:&lt;/p&gt;

&lt;p&gt;I have a Google Pixel 6A and a MacBook Air M1, so I needed to transfer files from my Mac to the phone. I expected that was going to be involved but managed to find a version for it on GitHub.&lt;/p&gt;

&lt;p&gt;So I installed the utility, and ran a couple of tests.&lt;/p&gt;

&lt;h4&gt;
  
  
  Transferred files from MacBook to Pixel
&lt;/h4&gt;

&lt;h4&gt;
  
  
  Transferred files from Pixel 6A to MacBook
&lt;/h4&gt;

&lt;p&gt;Follow these steps to get started:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/grishka/NearDrop" rel="noopener noreferrer"&gt;GitHub Link&lt;/a&gt;&lt;br&gt;
Open the Terminal on your Mac and execute the following command:&lt;br&gt;
&lt;code&gt;brew install --no-quarantine grishka/grishka/neardrop&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You’re all set to go!&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;To send a file from your Mac, right-click on the file, choose the Share option, and select NearDrop.&lt;/p&gt;

&lt;p&gt;On your Pixel, open the Files app and tap on Receive.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To share files from your phone to your Mac, just select the file, hit Share, and choose QuickShare. You’re ready to share!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Enjoy seamless file sharing!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>github</category>
      <category>opensource</category>
      <category>android</category>
    </item>
  </channel>
</rss>
