Angular apps as docker containers
ЁЯЪА **Getting Started with Docker the Right Way** ЁЯР│
Angular apps as docker containers
Basic docker image creation and running instances
Docker is an essential tool for modern software development, simplifying the
deployment process
and ensuring consistency across different environments. Here’s a quick guide on
how to properly start, stop, and manage Docker using `systemd` along with a few
handy commands to get you rolling!
### **Starting Docker with systemd**
To enable and start Docker using `systemd`, follow these commands:
```bash
systemctl enable docker
systemctl start docker
```
This ensures that Docker starts on boot and begins running immediately.
### **Stopping Docker**
To stop Docker, simply use:
```bash
sudo systemctl stop docker
```
### **Working with Docker Images and Containers**
1. **Pulling an Image**:
To pull the latest WordPress image, use:
```bash
docker pull wocker/wordpress
```
2. **Building a Custom Image**:
To build a custom Docker image, navigate to your Dockerfile directory and run:
```bash
sudo docker build -t ai3-docker-image .
```
3. **Listing Docker Images**:
To list all Docker images on your system, use:
```bash
sudo docker images ls
```
4. **Running a Container**:
To run a container and map ports, use the following commands:
- For port 3400:
```bash
sudo docker run -it -v ${PWD}:/usr/src/app -p 3400:4200 ai3-docker-image
```
- For port 4200:
```bash
sudo docker run -it -v ${PWD}:/usr/src/app -p 4200:4200 ai3-docker-image
```
By following these steps, you'll be well on your way to mastering Docker.
Remember, consistent and correct practices ensure smooth
operations and reliable deployments. Happy Dockerizing!
#Docker #DevOps #Containers #Systemd #SoftwareDevelopment #TechTips
#DevelopmentEnvironment
Comments
Post a Comment
Thanks
Warm regards,
Karthikeyan.T
tkarthikeyan@gmail.com
www.carthworks.com
Call us 09445 2772 06