Posts

Sample : template of docker file

 # Use an official base image FROM ubuntu:20.04 # Set environment variables ENV MY_ENV_VARIABLE=value # Set the working directory inside the container WORKDIR /app # Copy files from the build context to the container COPY . /app # Install dependencies RUN apt-get update && apt-get install -y package1 package2 # Expose a port to listen on EXPOSE 8080 # Specify a default command (can be overridden at runtime) CMD ["executable", "arg1", "arg2"] # Set the entry point for the container (overrides CMD) ENTRYPOINT ["executable"] # Define a volume for data persistence VOLUME /data # Label the image with metadata LABEL maintainer="your.name@example.com" version="1.0" # Add metadata to an image ADD file.tar.gz /data # Specify a user to run the container USER appuser # Healthcheck to monitor container health HEALTHCHECK --interval=30s --timeout=5s CMD curl -f http://localhost/ || exit 1 # Set stop signal STOPSIGNAL SIGTERM # Spec...

Docker Introduction

Image
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ All credit goes to the youtube creator Nana who helped me learn the below Docker full course. https://www.youtube.com/watch?v=3c-iBn73dDE Docker Hub https://hub.docker.com/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  https://www.youtube.com/watch?v=3c-iBn73dDE We will see how to use Docker in practice with a complete workflow with a demo project. 1. we will see how to develop locally with containers 2. we will run multiple containers and services with Docker Compose. 3. We will build our own image with docker file. And we will push that built image to a private docker repository on AWS. 4. Finally we will deploy our containerized application. 5. How to persist data in docker 6. Learning the different volume types after configure our persistence or demo projects Overview What container is and what problems it solves: Containers live in a container repository.  many com...