GithubHelp home page GithubHelp logo

install-and-configure-docker-on-wsl2's Introduction

install-&-configure-docker-on-wsl2

image

Insatlling docker on Ubuntu OS:

curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh

Starting the docker engine

sudo service docker start

Adding the docker to the group

sudo groupadd docker

Adding our user to the docker group

sudo usermod -aG docker $USER newgrp docker

Updating the system

sudo apt-get update

Install Docker compose

sudo apt-get install docker-compose-plugin

docker compose version

Added the below code to run docker in daemon mode as WSL2 doesn't support daemon by default

cd /home/user_name

ls -al

vi .profile

if grep -q "microsoft" /proc/version > /dev/null 2>&1; then 
if service docker status 2>&1 | grep -q "is not running"; then

    wsl.exe --distribution "${WSL_DISTRO_NAME}" --user root \
    
        --exec /usr/sbin/service docker start > /dev/null 2>&1
        
    fi
fi

esc then :wq to save and exit

๐Ÿ“ข You have successfully, Install and Configure Docker on your WSL2

Resource to follow along:

  1. https://docs.docker.com/engine/install/ubuntu/
  2. https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
  3. https://docs.docker.com/compose/install/linux/
  4. https://github.com/nickjj/dotfiles/commit/badd3265e5c8f6eca90d3b57df29292545332500

install-and-configure-docker-on-wsl2's People

Contributors

sumanprasad007 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.