Create a Docker Container to Compress Images Using MozJpeg

Create a Docker Container to Compress Images Using MozJpeg

Tiempo de lectura: 3 minutos Today we are going to create a Docker container that will allow us to compress jpg images within a directory. Compressing images is very important, especially when setting up a web service. This container will provide a powerful image compressor created by Mozilla and will speed up the download process for our users. First, we … Read more

Deja de instalar servicios en tu VPS, usa Docker

Tiempo de lectura: 2 minutos What is Docker? Docker is an open-source platform that automates the deployment of applications within software containers. These containers encapsulate all the necessary dependencies for an application to run efficiently in any environment, from development to production. Unlike traditional virtual machines, Docker containers do not include a complete operating system, making them extremely lightweight and … Read more

How to stop a Docker Compose container and delete the associated image, then create a new build

How to stop a Docker Compose container and delete the associated image, then create a new build

Tiempo de lectura: < 1 minuto Today we’re going to learn how to delete the Docker image when performing a Docker Compose down to then regenerate an update without generating garbage. The command we should use to stop the container and delete the associated image is: docker-compose down –rmi all This will remove the associated images of that Docker Compose. To … Read more

Redirect PHP errors to Docker console or Linux console

Redirect PHP errors to Docker console or Linux console

Tiempo de lectura: < 1 minuto Today we’re going to learn how to create a handler to redirect PHP errors to the Linux or Docker console. The first thing we need to do is to create a handler, we can call it exception_handler.php. And let’s add the following: <?php function handleException($exception) { // Get information about the exception $message = ‘ERR: … Read more

Install Docker and Docker Compose on Debian, quickly.

Install Docker and Docker Compose on Debian, quickly.

Tiempo de lectura: < 1 minuto Today we’re going to learn how we can install Docker and Docker Compose on Debian very quickly. First, we add the Debian repository keys. # 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/debian/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # … Read more

How to clear Docker build cache

How to clear Docker build cache

Tiempo de lectura: < 1 minuto To maintain our Docker system, we need to consider that the Build cache can fill up with unused data. In this case, we have 31.24 Gigabytes of cache. To remove it, we’ll need to use the following command: docker builder prune -a Or force deletion with: docker builder prune -a –force Clean manually: If necessary, … Read more

Deploying a Python Web Application with Docker and Flask

Deploying a Python Web Application with Docker and Flask

Tiempo de lectura: < 1 minuto In this tutorial, we will learn how to use Docker to deploy a basic Python web application using the Flask framework. :snake: Step 1: Project Structure Create a new folder named “MyAppFlask” in your project directory and navigate to it: mkdir ~/projects/MyAppFlask cd ~/projects/MyAppFlask Step 2: Flask Application Code Create a file named app.py with … Read more

Docker container to generate a React build

Docker container to generate a React build

Tiempo de lectura: < 1 minuto Hello, today I’m going to share a very useful container for generating a React build. It already contains everything needed to generate it. Additionally, it is compatible with Vite.js. The first thing we are going to do is create the file docker-compose.yml version: ‘3.1’ services: react-app: container_name: react-app build: context: . dockerfile: Dockerfile volumes: – … Read more

Install Docker and Docker Compose on Ubuntu, very fast

Tiempo de lectura: < 1 minuto Let’s install Docker Compose on Ubuntu by following the official Docker website instructions. Update dependencies and install necessary packages: sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg sudo gpg –dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg # Add the repository to Apt sources: echo \ … Read more

Use a Docker Registry with authentication together with Kubernetes

Use a Docker Registry with authentication together with Kubernetes

Tiempo de lectura: 4 minutos If your Docker Registry requires authentication with a username and password, you’ll need to provide those credentials to the Kubernetes cluster so it can access the registry images during deployment. Here’s an example of how you can do it: Using Docker Compose with Docker Registry with Authentication Let’s assume your original Docker Compose looks like … Read more