DEV Community

Randika Madhushan Perera
Randika Madhushan Perera

Posted on

1

Docker Hands-On Part 01

01. Initializing the Docker Environment

Installing Docker CE

Installing Required Packages: If you are using Essential packages for Docker CE in CentOS, such as utils, device-mapper-persistent-data, and lvm2, are installed using the yum package manager.

I'm using the Linux EC2 2023 server.

To install Docker on Amazon Linux 2 or Amazon Linux 2023

1.Update the installed packages and package cache on your instance.

$ sudo yum update -y
Enter fullscreen mode Exit fullscreen mode

2.Install the most recent Docker Community Edition package.

For Amazon Linux 2, run the following:

$ sudo amazon-linux-extras install docker
Enter fullscreen mode Exit fullscreen mode

For Amazon Linux 2023, run the following:

$ sudo yum install -y docker
Enter fullscreen mode Exit fullscreen mode

3.Start and enable the Docker service

$ systemctl enable --now docker.service
$ systemctl ststus docker.service
Enter fullscreen mode Exit fullscreen mode

Add the ec2-user to the docker group so that you can run Docker commands without using sudo.

$ sudo usermod -a -G docker ec2-user
Enter fullscreen mode Exit fullscreen mode

Pick up the new docker group permissions by logging out and logging back in again. To do this, close your current SSH terminal window and reconnect to your instance in a new one. Your new SSH session should have the appropriate docker group permissions.

Verify that the ec2-user can run Docker commands without using sudo.

$ docker ps -a
Enter fullscreen mode Exit fullscreen mode

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay