Issue with docker-entrypoint.d (No such file or directory)

Context

I want to extend Label Studio and run a Docker image of a local image.

When I try to run the container with docker-compose, I get the following errors:

  • app-1 | /label-studio/deploy/docker-entrypoint.d/app/11-configure-custom-cabundle.sh: line 1: ../common/11-configure-custom-cabundle.sh: No such file or directory
  • nginx-1 | /label-studio/deploy/docker-entrypoint.d/nginx/10-configure-nginx.sh: line 1: ../common/10-configure-nginx.sh: No such file or directory

However, I checked the paths and they seem correct (see screenshot below):

image

Setup

  • OS: Windows 11 (22H2)
  • Install method: Locally cloned repository of Label Studio
  • Docker: version 26.1.4, build 5650f9b
  • No modifications to docker-compose.yml and Dockerfile

Steps to reproduce

  1. Build the local image: docker build -t heartexlabs/label-studio:latest .
  2. Run local image with Docker compose: docker-compose up -d
  3. Open browser at 127.0.0.1:8080 (expected: “This site can’t be reached”)

I opened the multi-app container in Docker Desktop to view the output.

The errors you’re encountering suggest that the scripts 11-configure-custom-cabundle.sh and 10-configure-nginx.sh are not being found in the expected directories. This could be due to several reasons, such as incorrect paths in the Dockerfile or issues with the build context.

Here are some steps to troubleshoot and resolve the issue:

  1. Check Dockerfile and docker-compose.yml Paths: Ensure that the paths specified in your Dockerfile and docker-compose.yml are correct and relative to the build context.
  2. Verify File Existence: Confirm that the files 11-configure-custom-cabundle.sh and 10-configure-nginx.sh exist in the specified directories. They should be in the common directory relative to the scripts that are trying to source them.
  3. Adjust Dockerfile: If the paths are correct but the files are still not found, you might need to adjust the Dockerfile to ensure the files are copied to the correct locations. Here’s an example of how you might adjust the Dockerfile:
# Dockerfile
FROM python:3.8-slim

# Set the working directory
WORKDIR /label-studio

# Copy the necessary files
COPY . /label-studio

# Ensure the common scripts are in the correct location
RUN mkdir -p /label-studio/deploy/docker-entrypoint.d/common
COPY deploy/docker-entrypoint.d/common/11-configure-custom-cabundle.sh /label-studio/deploy/docker-entrypoint.d/common/
COPY deploy/docker-entrypoint.d/common/10-configure-nginx.sh /label-studio/deploy/docker-entrypoint.d/common/

# Other Dockerfile instructions...
  1. Rebuild the Docker Image: After making the necessary adjustments, rebuild the Docker image:
docker build -t heartexlabs/label-studio:latest .
  1. Run Docker Compose: Once the image is rebuilt, run Docker Compose:
docker-compose up -d
  1. Check Docker Logs: If the issue persists, check the Docker logs for more detailed error messages:
docker-compose logs
  1. Example docker-compose.yml: Ensure your docker-compose.yml is correctly set up. Here’s an example configuration:
version: '3.8'

services:
  app:
    image: heartexlabs/label-studio:latest
    ports:
      - "8080:8080"
    volumes:
      - ./mydata:/label-studio/data
    environment:
      - LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
      - LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/label-studio/data/images

  nginx:
    image: nginx:latest
    ports:
      - "80:80"
    depends_on:
      - app
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf

By following these steps, you should be able to resolve the issues with the missing scripts and successfully run your local Docker image of Label Studio. If you continue to encounter issues, please provide more details or screenshots of your Dockerfile and docker-compose.yml for further assistance.