Question

Docker deploy to app platform fails while local build succeeds (/proc/1/mem: input/output error)

Hi there! I just tried to deploy a new Docker app to the app plattform and keep getting a strange error while attempting to run a simple apk update:

No cached layer found for cmd RUN apk update 
[2021-12-06 10:17:58] error building image: error building stage: failed to optimize instructions: read /proc/1/mem: input/output error
[2021-12-06 10:17:58] 
[2021-12-06 10:17:58] command exited with code 1
[2021-12-06 10:17:58] du: /proc/203: No such file or directory
[2021-12-06 10:17:59]  ! Build failed (exit code 1)

Building locally works just fine and I’m using the same Dockerfile with other projects where it works without a complaint.

Any ideas?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

I figured my issue out in the end. Even though the deployment failed at the first RUN command the actual issue was further down.

The COPY .. /app/ statement tries to access a directory outside of my project and that’s what made the whole build fail. I changed it to COPY . /app/ and everything worked.

FROM webdevops/php-apache:8.0-alpine
WORKDIR /app

ENV WEB_DOCUMENT_ROOT=/app/public

COPY docker/config/provision/ /opt/docker/provision/

RUN docker-service enable cron \
    && apk update \
    && apk add --no-cache libpng-dev g++ make bash zlib-dev nano php8-bcmath php8-mysqli php8-pdo php8-pdo_mysql redis \
    && echo "APP_KEY=" > .env

COPY composer.json composer.lock /app/

RUN composer install --ignore-platform-reqs --no-scripts

COPY .. /app/

RUN composer run-script post-autoload-dump \
    && php artisan key:generate \
    && chown -R application:application * \
    && find . -type d -exec chmod 775 {} \; \
    && find . -type f -exec chmod 664 {} \; \
    && find /opt/docker/bin/service.d/* -type f -exec chmod 775 {} \;

ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
CMD ["supervisord"]

Hi There, What droplet are you using in DO ?

Also, can you put the Dockerfile or docker-compose file here ?

BR

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more