Skip to main content

Posts

Showing posts with the label AWS

RUN and CMD instructions in Docker

In Docker, the RUN and CMD instructions serve different purposes, primarily relating to when and how commands are executed within the container lifecycle. RUN Instruction : Purpose : The RUN command is used to build the image. It executes the specified command(s) and commits the result to the image, so the changes become part of the image layers. Execution Time: During the build phase of the Docker image. Use Case : Commonly used for installing software, setting up files, or configuring the environment. RUN apt-get update && apt-get install -y nginx Here, RUN installs nginx in the image. When the image is built, the installed software is included in the image. CMD Instruction : Purpose : The CMD command provides default instructions for the container. It defines what should be executed when a container starts. Execution Time: At container runtime (when the container is launched from the image). Use Case : Typically, used to specify the main application or command to ...

Docker - Basic Details

Docker is an advanced  OS virtualization  software  platform  that makes it easier to create, deploy, and run applications in a Docker container. Docker is a container management service. The keywords of Docker are  build, ship  and  run  anywhere. The whole idea of Docker is for developers to easily develop applications, ship them into containers which can then be deployed anywhere.  Docker allows the developers to choose the project-specific deployment environment for each project with a different set of tools and application stacks. Docker provides flexibility and portability to run an application in various locations, whether on-premises or in a public cloud or a private cloud. Features of Docker Docker has the ability to reduce the size of development by providing a smaller footprint of the operating system via containers. With containers, it becomes easier for teams across different units, such as development, QA and Operations to work ...

Difference between ADD and COPY in Dockerfile

In a Dockerfile, both ADD and COPY are used to copy files or directories from the source on the host machine to the image.  However, they have some key differences: Basic Functionality : COPY : A straightforward command for copying files or directories from the source (host) into the container image. ADD : Does everything that COPY does but with additional functionalities. Additional Features in ADD : Automatic Extraction of Archives : ADD can automatically unpack compressed files (e.g., .tar , .tar.gz , .tar.bz2 ) into the container. This feature is not available with COPY . Remote URL Support : ADD allows you to specify a URL as the source, downloading the file directly into the container. COPY only supports local files and directories. When to Use : COPY is generally preferred for simple file or directory copying tasks because it’s more explicit and doesn't introduce unintended behaviors like auto-extraction or downloading. ADD is more appropriate when you specifically n...

Add Docker's official GPG key

  While installing Docker on Linux machine we need to add Docker's official GPG key. Question is ... Why we need to Add Docker's official GPG key? --- Adding Docker's official GPG (GNU Privacy Guard) key is an essential step in verifying the integrity and authenticity of Docker packages when installing Docker on a system, especially in Linux environments. Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository. Example: Set up Docker's  apt  repo sitory. # Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: echo \   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/do...

Explain - AWS CloudFront

What is AWS CloudFront? AWS CloudFront is a Content Delivery Network (CDN) service provided by Amazon Web Services (AWS). It’s designed to speed up the delivery of static and dynamic web content, such as HTML, CSS, JavaScript, and image files, to users by caching the content at strategically located data centers worldwide, known as edge locations .  When a user requests content, CloudFront serves it from the nearest edge location, reducing latency and improving load times. Key Features of CloudFront: Caching and Distribution : CloudFront caches content at edge locations to reduce the load on the origin server and to deliver content quickly to users across the globe. Origin Integration : It integrates seamlessly with other AWS services like S3, EC2, and even custom origin servers outside AWS, serving content directly from these sources. Dynamic Content Acceleration : CloudFront accelerates not only static but also dynamic content by optimizing routes based on AWS's global network. S...