OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Deploying a pelican site to Google Cloud Run with Dockerfile not working

  • Thread starter Thread starter danni114
  • Start date Start date
D

danni114

Guest
I have a website built with pelican site generator, and I would like to dockerize it and deploy it to GCP using Cloud Run. I'm not super familiar with docker and can't figure out what to use as my ENTRYPOINT. So far I have this in my Dockerfile:

Code:
FROM python:3.10-slim-bullseye AS pelican

EXPOSE 80

RUN apt update && apt install -y --no-install-recommends git \
  make \
  && rm -rf /var/lib/apt/lists/*

ADD requirements.txt requirements.txt
RUN python -m pip install --no-cache-dir -r requirements.txt

# prevent writing .pyc files
ENV PYTHONDONTWRITEBYTECODE 1

# bust the cache 
WORKDIR /website 
COPY . /website/

RUN pelican

FROM httpd:2.4.52-alpine
COPY --from=pelican /website/output/ /usr/local/apache2/htdocs/

And when I build and run with docker run -d -p 8080:80 website my website is running alright at localhost:8080. However when I deploy this to GCP Cloud Run, I get this error

Code:
terminated: Application failed to start: failed to resolve binary path: error finding executable "docker run -d -p 8080:80 website" in PATH [/usr/local/apache2/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin]: no such file or directory

And I've put docker run -d -p 8080:80 website as my container arguments.

I've followed steps outlined here https://cloud.google.com/build/docs/build-push-docker-image for building the image, deploy it to Artifact Registry, but I wasn't able to run the image or deploy it to cloud run. There are also more generic error messages like

Code:
"efault STARTUP TCP probe failed 1 time consecutively for container "xx-image-1" on port 8080. The instance was not started.

Not sure how to proceed from here. Thanks in advance!
<p>I have a website built with pelican site generator, and I would like to dockerize it and deploy it to GCP using Cloud Run. I'm not super familiar with docker and can't figure out what to use as my <code>ENTRYPOINT</code>. So far I have this in my <strong>Dockerfile</strong>:</p>
<pre><code>FROM python:3.10-slim-bullseye AS pelican

EXPOSE 80

RUN apt update && apt install -y --no-install-recommends git \
make \
&& rm -rf /var/lib/apt/lists/*

ADD requirements.txt requirements.txt
RUN python -m pip install --no-cache-dir -r requirements.txt

# prevent writing .pyc files
ENV PYTHONDONTWRITEBYTECODE 1

# bust the cache
WORKDIR /website
COPY . /website/

RUN pelican

FROM httpd:2.4.52-alpine
COPY --from=pelican /website/output/ /usr/local/apache2/htdocs/
</code></pre>
<p>And when I build and run with <code>docker run -d -p 8080:80 website</code> my website is running alright at localhost:8080. However when I deploy this to GCP Cloud Run, I get this error</p>
<pre><code>terminated: Application failed to start: failed to resolve binary path: error finding executable "docker run -d -p 8080:80 website" in PATH [/usr/local/apache2/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin]: no such file or directory
</code></pre>
<p>And I've put <code>docker run -d -p 8080:80 website</code> as my container arguments.</p>
<p>I've followed steps outlined here <a href="https://cloud.google.com/build/docs/build-push-docker-image" rel="nofollow noreferrer">https://cloud.google.com/build/docs/build-push-docker-image</a> for building the image, deploy it to Artifact Registry, but I wasn't able to run the image or deploy it to cloud run. There are also more generic error messages like</p>
<pre><code>"efault STARTUP TCP probe failed 1 time consecutively for container "xx-image-1" on port 8080. The instance was not started.
</code></pre>
<p>Not sure how to proceed from here. Thanks in advance!</p>
Continue reading...
 

Latest posts

A
Replies
0
Views
1
Anthonin Chaboteaux
A
Top