cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Docker Container gives 'Permission Denied' error when starting

Docker Container gives 'Permission Denied' error when starting

stephenOtis
Established Member

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.

2023-11-21_10h12_51.png

 

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}"

2023-11-21_15h31_28.png

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.

stephenOtis_0-1700609406161.png

 

5 REPLIES 5

MauroRiboniMX
Contributor

Hello, 

Can i see your snapcraft.yaml? 😃

Sure, @MauroRiboniMX . Here it is, thank you for your help!

2023-11-22_04h41_34.png

Some further ideas...I investigated this on Github and stumbled across this note about issues with bind mount vs. named volumes causing permission issues.

https://github.com/thirdgen88/ignition-docker/issues/1

Is there a way to use named volumes using the Container Engine, and what would be the structure? My attempts to modify the docker-compose.yml to use named volumes result in a snap that isn't recognized by the Container Engine.

I contact you on DM 🙂

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

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist