Вот запись скрипта Python:
Код: Выделить всё
async def main():
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('--config_file', type=str, default='config.json')
arg_parser.add_argument('--log_dir', type=str, default='log')
arg_parser.add_argument('--out_dir', type=str, default='out')
args = arg_parser.parse_args()
Код: Выделить всё
# Use an official Python runtime as a parent image
FROM python:3.12-slim
# Set the working directory in the container
WORKDIR /root
# Copy the requirements file and install dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code into the container
COPY app/ /root/app
# Command to run the Python script when the container starts
CMD ["python", "app/main.py"]
Код: Выделить всё
sudo docker run --network=host -v /home//host:/root/host -v /etc/localtime:/etc/localtime:ro myapp --config_file a.json
Код: Выделить всё
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "--config_file a.json": executable file not found in $PATH
Подробнее здесь: https://stackoverflow.com/questions/798 ... nts-are-pa
Мобильная версия