Docker Container gives 'Permission Denied' error when starting

I have been testing building a Docker snap for my ctrlX Core X7 to run in the Container Engine. I have been able to build the Docker image and build the corresponding snap to load it on the Core. When I install it, it shows up in the Container Engine app. However, when I try to run the app, I get an error that the initialization script got a 'Permission Denied' error.

ย 

When I download the image.tar.gz file and extract the corresponding docker-entrypoint.sh file and go to the offending line in the script, I see that it is trying to use the echo command to write a value to a file/create a file in the docker volume.

info "Adding ${key}=${val} to $(basename "${init_file}")"
echo "${key}=${val}" >> "${init_file}"

Why am I getting this error? I appear to have supplied read/write access in my docker-compose.yml file so i'm not sure what I could be missing here.

ย 

Best reply by StephenO

I was able to figure out the solution for the permission denied issue. The modification was in the docker-compose.yml and using named volumes instead of bind mounting. Here is the final file I am using to run my Ignition docker file.

services:
    ignition:
        image: ${IMAGE_NAME}:${IMAGE_TAG}
        container_name: ignition
        ports:
            - 9088:8088
            - 9043:8043
        volumes:
            - ignition_data:/usr/local/bin/ignition/data:rw
        command: 
            -n ctrlx-ignition 
            -a localhost 
            -h 9088 
            -s 9043
        environment: 
            - ACCEPT_IGNITION_EULA=Y
            - GATEWAY_ADMIN_USERNAME=admin
            - GATEWAY_ADMIN_PASSWORD=password
            - IGNITION_EDITION=standard
        restart: on-failure
volumes:
    ignition_data:
      driver: local
      driver_opts:
        type: none
        o: bind
        device: ${SNAP_DATA}/docker-volumes/ctrlx-docker-ignition

ย 

View original
1
5 replies