Kaniko executer is failing with error "Permission denied: AH00099: could not create /var/run/apache2/apache2.pid" #1666
Labels
area/behavior
all bugs related to kaniko behavior like running in as root
area/permissions
area/uid
categorized
differs-from-docker
issue/dockerfile-specific
issue/permission-denied
kind/bug
Something isn't working
priority/p0
Highest priority. Break user flow. We are actively looking at delivering it.
works-with-docker
Hello,
I have a dockerfile which is working fine with docker-inside-docker ( dind) in gitlab ci but while working with Kaniko executer i am getting error "
[Wed Jun 09 06:12:44.044978 2021] [core:error] [pid 1] (13)Permission denied: AH00099: could not create /var/run/apache2/apache2.pid
[Wed Jun 09 06:12:44.045029 2021] [core:error] [pid 1] AH00100: apache2: could not log pid to file /var/run/apache2
".
Could you please help?
Dockerfile ----------
Base Image to build CCareV2 Application
FROM dockerfactory-unstable-iva.si.francetelecom.fr/ankit-base-image/apache2-php-zts:v2
LABEL name="CCv2 application"
description="CCareV2 application dockerfile"
url="https://gitlab.tech.orange/OrangeMoney/CCare/ccarev2-omcloud"
maintainer="abhishek.kaul@orange.com"
RUN useradd -u 1001 -g root -G www-data -r orange_money &&
usermod -aG root www-data &&
mkdir -p /var/www/html/ccare/ &&
mkdir -p /var/run/apache2/ &&
chown -R orange_money:www-data /var/run/apache2/ &&
chmod -R 777 /etc/apache2/sites-available/ /var/run/apache2/ &&
rm -rf /etc/apache2/sites-enabled/000-default.conf
COPY application /var/www/html/ccare/application/
COPY languages /var/www/html/ccare/languages/
COPY library /var/www/html/ccare/library/
COPY public /var/www/html/ccare/public/
COPY index.php /var/www/html/ccare/
COPY .htaccess /var/www/html/ccare/
COPY files/oma-ccare2-httpd.conf /etc/apache2/sites-available/
COPY scripts/check_session.sh /opt/check_session.sh
COPY scripts/updateparam.sh /opt/updateparam.sh
ENV CONFIG_PATH=/var/www/html/ccare/application/configs
RUN chown -R www-data:www-data /var/www/html &&
chmod -R 777 /var/www/html/ &&
chmod -R 777 /usr/local/etc/php/ &&
chmod -R 777 /usr/local/etc/php/php.ini-production &&
chmod -R 777 /usr/local/etc/php/php.ini-development &&
chmod -R 755 /opt/check_session.sh &&
chmod -R 755 /opt/updateparam.sh &&
sh /opt/updateparam.sh &&
a2dismod mpm_event && a2enmod mpm_prefork && a2enmod remoteip && a2enmod rewrite && a2enmod && a2ensite oma-ccare2-httpd
USER 1001
EXPOSE 8080
ENTRYPOINT ["apache2","-D","FOREGROUND"]
GITLAB CI -----------
qa-package-job:
stage: package
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
tags:
- graas
- prod
- shared
variables:
KANIKO_CACHE_DIR: "${CI_PROJECT_DIR}/.cache"
script:
- mkdir -p /kaniko/.docker
- export KANIKO_CONTEXT="${CI_PROJECT_DIR}"
- echo "{"auths":{"${REGISTRY_LOGIN_TEST_URL}":{"username":"${ARTIFACTORY_USERNAME}","password":"${ARTIFACTORY_PASSWORD}"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context ${KANIKO_CONTEXT} --dockerfile ${KANIKO_CONTEXT}/Dockerfile_ccarev2 --destination ${REGISTRY_LOGIN_TEST_URL}/oma-ccarev2-multi:${IMAGE_TAG}
environment:
name: qa
only:
- ccarev2-paas
- graas
The text was updated successfully, but these errors were encountered: