I'm new to Docker and recently attempted to set up Apache Airflow within a Docker container following some online tutorials. Here's a breakdown of the steps I've taken: I ran a Docker container using the command:docker run -it --rm -p 8888:8080 python:3.8-slim /bin/bash I created a separate path for Apache Airflow using:export AIRFLOW_HOME=/opt/airflow I added a user named "airflow" using:useradd -ms /bin/bash -d ${AIRFLOW_HOME} airflow I navigated to the path and created a virtual environment for Apache Airflow:su - airflow cd /opt/airflow python -m venv .airflowvirtualenv source .airflowvirtualenv/bin/activate However, upon restarting my machine, I encountered an issue. The Docker GUI showed the container and its associated image file, and I could access the container's root user. But when I tried to access the "airflow" user and its virtual environment, I received a "User does not exist" error.
My goal was to retain the user setup and virtual environment and installed airflow python across container restarts. I'm not sure how to effectively persist these changes within Docker containers, and I'd appreciate guidance on how to accomplish this.
Could anyone provide insights into how I can retain user setups and virtual environments in Docker containers to use Apache Airflow consistently across restarts?
However, the issue arose when I restarted my machine. While the Docker GUI displayed the container and associated image file, I was only able to access the container's root user. Attempting to access the "airflow" user and its virtual environment resulted in a "User does not exist" error.