Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to install and enable docker on command line with EC2 instance

sudo yum update -y
sudo amazon-linux-extras install docker -y
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -a -G docker ec2-user (to avoid sudo command usage)
newgrp docker (to avoid sudo command usage)
Comment

install docker ec2

sudo amazon-linux-extras install docker -y
Comment

install docker ec2

sudo service docker start
Comment

Install Docker Engine on EC2 Instance

# Install Docker Engine on EC2 Instance
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user

LOGOUT and login

sudo su - ec2-user

# Build Docker Image
cd aws-sa-associate-saac02/09-Containers-ECS/container_of_cats/container
docker build -t containerofcats .
docker images --filter reference=containerofcats

# Run Container from Image
docker run -t -i -p 80:80 containerofcats

# Upload Container to Dockerhub (optional)
docker login --username=YOUR_USER
docker images
docker tag IMAGEID YOUR_USER/containerofcats
docker push YOUR_USER/containerofcats:latest
Comment

install docker ec2

sudo yum update -y
Comment

install docker ec2

sudo usermod -a -G docker ec2-user
Comment

PREVIOUS NEXT
Code Example
Shell :: install docker on windows powershell 
Shell :: stop git from tracking a folder 
Shell :: ubuntu iso download 
Shell :: comment in shell script 
Shell :: sed remove line after match 
Shell :: asyncstorage community 
Shell :: install Homebrew on mac or linux 
Shell :: install homebrew 
Shell :: download code from github 
Shell :: install spectacle brew 
Shell :: git uncommit last commit but keep changes 
Shell :: git origin set branch 
Shell :: bash load file into list 
Shell :: bash division integer 
Shell :: clean journal 
Shell :: how to activate virtual environment in ubuntu 20.04 
Shell :: yarn 2 upgrade all packages 
Shell :: list user groups linux 
Shell :: convert cer to crt linux mint 
Shell :: npm slugify 
Shell :: git specify ssh key for repo 
Shell :: adding in ssh agent 
Shell :: python pytorch 
Shell :: install react native ubuntu 
Shell :: install specific version of docker on ubuntu 
Shell :: delete tag beautifulsoup 
Shell :: conda install line_profiler 
Shell :: un add file in git 
Shell :: git discard all unpushed commits 
Shell :: new branch not showing in visual studio 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =