Sources
[Creating connection to AWS instance using PuTTy]
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html?icmpid=docs_ec2_console
[Running docker on aws] https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html
- Launch a AWS instance
- Create and download new key pair
- Open PuttyGen
- Load the new key pair
- Generate and save the new private key pair
- Open Putty, copy the "ec2-user@csdjncs" into the Hostname tab as follows
- In SSH -> Auth -> Click Browse and select the generated key
- Open the connection.
Install Docker
- Update the installed packages and package cache on your instance.
sudo yum update -y
- Install the most recent Docker Community Edition package.
sudo amazon-linux-extras install docker
- Start the Docker service.
sudo service docker start
- Add the
ec2-user
to thedocker
group so you can execute Docker commands without usingsudo
.sudo usermod -a -G docker ec2-user
- Log out and log back in again to pick up the new
docker
group permissions. You can accomplish this by closing your current SSH terminal window and reconnecting to your instance in a new one. Your new SSH session will have the appropriatedocker
group permissions. - Verify that the
ec2-user
can run Docker commands withoutsudo
.docker info
NoteIn some cases, you may need to reboot your instance to provide permissions for theec2-user
to access the Docker daemon. Try rebooting your instance if you see the following error:Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Run the rstudio image
docker run -d -p 8787:8787 -e ROOT=TRUE -e PASSWORD=yourpasswordhere rocker/rstudio
Get the ip of the instance from the public IP entry
in the browser enter xxx.xxx.xxx.xxx:8787
Make sure to make the file on s3 public
Select file -> Actions -> make public
For launch scripts
#-- Linux AMI 2018.03
#-- Ubuntu
sudo yum update -y
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
wget "https://abolfadl.s3.eu-central-1.amazonaws.com/docker/images/mabolfadl_rstudio_libs.tar"
in the browser enter xxx.xxx.xxx.xxx:8787
Make sure to make the file on s3 public
Select file -> Actions -> make public
For launch scripts
#-- Linux AMI 2018.03
#!/bin/bash
yum update -y
yum-config-manager --enable rhui-REGION-rhel-server-extras
yum -y install docker
service docker start
usermod -a -G docker ec2-user
cd /home/ec2-user/
wget "https://abolfadl.s3.eu-central-1.amazonaws.com/docker/images/mabolfadl_rstudio_libs.tar"
#-- After opening a shell with putty
docker load < mabolfadl_rstudio_libs.tar
docker run -p 8787:8787 -e PASSWORD=asd123 $(docker images -q)
yum update -y
yum-config-manager --enable rhui-REGION-rhel-server-extras
yum -y install docker
service docker start
usermod -a -G docker ec2-user
cd /home/ec2-user/
wget "https://abolfadl.s3.eu-central-1.amazonaws.com/docker/images/mabolfadl_rstudio_libs.tar"
#-- After opening a shell with putty
docker load < mabolfadl_rstudio_libs.tar
docker run -p 8787:8787 -e PASSWORD=asd123 $(docker images -q)
#-- Ubuntu
sudo yum update -y
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
wget "https://abolfadl.s3.eu-central-1.amazonaws.com/docker/images/mabolfadl_rstudio_libs.tar"
#-- After opening a shell with putty
docker load < mabolfadl_rstudio_libs.tar
docker run -p 8787:8787 -e PASSWORD=asd123 $(docker images -q)
docker load < mabolfadl_rstudio_libs.tar
docker run -p 8787:8787 -e PASSWORD=asd123 $(docker images -q)
No comments:
Post a Comment