Skip to content

"RUN chmod +x /usr/local/bin/cloud-run-entrypoint.sh" is need in Dockerfile #2

@excelsior091224

Description

@excelsior091224

I tried to deploy this code, but this error was occured when I run setup.sh.

Deploying container to Cloud Run service [wordpress] in project [xxxxx-xxxxx-xxxxx] region [us-central1]
⠶ Deploying new service... Invalid ENTRYPOINT. [name: "gcr.io/xxxxx-xxxxx-xxxxx/wordpress@sha256:b71d07578155a74007b8ff1c6fe7e62c71080380897fe04c086221c598fdd686"
error: "Command \"cloud-run-entrypoint.sh\": invalid mode \"-rw-r--r--\" for /usr/local/bin/cloud-run-entrypoint.sh"
].. Routing traffic...
  X Creating Revision... Invalid ENTRYPOINT. [name: "gcr.io/xxxxx-xxxxx-xxxxx/wordpress@sha256:b71d07578155a74007b8ff1c6fe7e62c71080380897fe04c086221c598fdd686"
X Deploying new service... Invalid ENTRYPOINT. [name: "gcr.io/xxxxx-xxxxx-xxxxx/wordpress@sha256:b71d07578155a74007b8ff1c6fe7e62c71080380897fe04c086221c598fdd686"
error: "Command \"cloud-run-entrypoint.sh\": invalid mode \"-rw-r--r--\" for /usr/local/bin/cloud-run-entrypoint.sh"
].



Deployment failed
ERROR: (gcloud.run.deploy) Invalid ENTRYPOINT. [name: "gcr.io/xxxxx-xxxxx-xxxxx/wordpress@sha256:b71d07578155a74007b8ff1c6fe7e62c71080380897fe04c086221c598fdd686"
error: "Command \"cloud-run-entrypoint.sh\": invalid mode \"-rw-r--r--\" for /usr/local/bin/cloud-run-entrypoint.sh"
].

So I added RUN chmod +x /usr/local/bin/cloud-run-entrypoint.sh in Dockerfile bellow COPY wordpress/cloud-run-entrypoint.sh /usr/local/bin/, it works.

Dockerfile

# See https://hub.docker.com/_/wordpress/ for the latest
FROM wordpress:5.3.2-php7.4-apache

EXPOSE 8080
# Use the PORT environment variable in Apache configuration files.
RUN sed -i 's/80/${PORT}/g' /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf
# wordpress conf
COPY wordpress/wp-config.php /var/www/html/wp-config.php

# Copy WordPress THEMES
COPY themes /usr/src/wordpress/wp-content/themes/

# Copy WordPress PLUGINS
COPY plugins /usr/src/wordpress/wp-content/plugins/

# download and install cloud_sql_proxy
RUN apt-get update && apt-get install curl
RUN curl -o /usr/local/bin/cloud_sql_proxy https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 && chmod +x /usr/local/bin/cloud_sql_proxy

# custom entrypoint
COPY wordpress/cloud-run-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/cloud-run-entrypoint.sh


ENTRYPOINT ["cloud-run-entrypoint.sh","docker-entrypoint.sh"]
CMD ["apache2-foreground"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions