I have a docker image that looks like

FROM ubuntu:18.04

RUN apt-get update; \
  apt-get install -y libsnappy-dev software-properties-common; \
  add-apt-repository universe ldconfig; \
  add-apt-repository ppa:certbot/certbot \
  apt-get update


COPY . /

CMD  chmod 777 build;

with build looking like

./database & (sleep 3s && ./server);

And I have this up and running on my compute engine instance, I now need to make sure that my VM is https. I've tried running certbot through ssh, But as it is a read only system, and I don't quite understand How am I am to certify the website.


2 Answers 2


To use SSL on my virtual machine. I used https://letsencrypt.org/. They make it very easy. Also you can use openssl to view your certificate. echo | openssl s_client -showcerts -servername gnupg.org -connect gnupg.org:443 2>/dev/null | openssl x509 -inform pem -noout -text Displaying a remote SSL certificate details using CLI tools I am not familiar with using the google compute engine in particular, but from my understanding you should be able to treat it as a virtual machine.


For SSL follow below steps

  1. domain name should associated with your server’s public IP address.
  2. openssl req -x509 -nodes -days 365 -serverkey rsa:2048 -keyout server.key -out server.crt
  3. Create a Nginx default.conf
  4. create a Dockerfile Follow link

Some more references Enabling HTTPS with Let's Encrypt on Docker and container-instances-container-group-ssl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.