Not being able to make kubernetes, could someone help me?

I'm not able to upload the image build, it gives an error in the dockerfile, how do I do the dockerfile:

Install the container's OS.

FROM ubuntu:latest as HUGOINSTALL

Install Hugo.

RUN apt-get update
RUN apt-get install hugo

Copy the contents of the current working directory to the hugo-site

directory. The directory will be created if it doesn't exist.

COPY . /hugo-site

Use Hugo to build the static site files.

RUN hugo -v --source=/hugo-site --destination=/hugo-site/public

Install NGINX and deactivate NGINX's default index.html file.

Move the static site files to NGINX's html directory.

This directory is where the static site files will be served from by NGINX.

FROM nginx:stable-alpine
RUN mv /usr/share/nginx/html/index.html /usr/share/nginx/html/old-index.html
COPY --from=HUGOINSTALL /hugo-site/public/ /usr/share/nginx/html/

The container will listen on port 80 using the TCP protocol.

EXPOSE 80

Another question, I'm name here, I wanted to know how to put dockerfile error image

2 Replies

Taking a look at what you have posted it looks like you were using the Create and Deploy a Docker Container Image to a Kubernetes Cluster from the Linode Doc site.

Following the guide, here is the error I encountered after creating the Dockerfile and trying to build the image.

ERROR: failed to solve: process "/bin/sh -c apt-get install hugo" did not complete successfully: exit code: 1
This error comes from the OS version not playing nice with installing Hugo. Once I change the OS versions to 18.04 it worked fine. So you should lower the version on this to get it to work.

If you still have the error, please share it so that we can better diagnose the error.

-Dan

Changing to 18.04 did not work for me.

The first two examples have now not worked. I'm going to work with an existing image of my own making to complete the guide.

[MacOS-Brew-Hugo]

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct