Building docker file successful,but lab validations fails

[steve@stapp02 docker]$
[steve@stapp02 docker]$ sudo docker build -t 2.4.43 .
[+] Building 7.5s (10/10) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 629B 0.0s
=> WARN: Empty continuation line found in: RUN sed -i “s/Listen 80/Listen 8080/g” /usr/lo 0.0s
=> [internal] load metadata for Docker Hub Container Image Library | App Containerization 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/5] FROM Docker Hub Container Image Library | App Containerization 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 157B 0.0s
=> [2/5] RUN sed -i “s/Listen 80/Listen 8080/g” /usr/local/apache2/conf/httpd.conf && 3.4s
=> [3/5] COPY certs/server.crt /usr/local/apache2/conf/server.crt 1.0s
=> [4/5] COPY certs/server.key /usr/local/apache2/conf/server.key 1.0s
=> [5/5] COPY html/index.html /usr/local/apache2/htdocs/ 0.9s
=> exporting to image 1.2s
=> => exporting layers 1.2s
=> => writing image sha256:a71abf23fcb477768d250bd991ef2c1b6877cefc4d23c23be83d930402dae9 0.0s
=> => naming to Docker Hub Container Image Library | App Containerization 0.0s

1 warning found (use docker --debug to expand):

  • Empty continuation line found in: RUN sed -i “s/Listen 80/Listen 8080/g” /usr/local/apache2/conf/httpd.conf && sed -i ‘/LoadModule\ ssl_module modules/mod_ssl.so/s/^#//g’ /usr/local/apache2/conf/httpd.conf && sed -i ‘/LoadModule\ socache_shmcb_module modules/mod_socache_shmcb.so/s/^#//g’ /usr/local/apache2/conf/httpd.conf && sed -i ‘/Include\ conf/extra/httpd-ssl.conf/s/^#//g’ /usr/local/apache2/conf/httpd.conf
    [steve@stapp02 docker]$ sudo vi Dockerfile
    [steve@stapp02 docker]$ sudo docker build -t 2.4.43 .
    [+] Building 0.1s (10/10) FINISHED docker:default
    => [internal] load build definition from Dockerfile 0.0s
    => => transferring dockerfile: 626B 0.0s
    => [internal] load metadata for Docker Hub Container Image Library | App Containerization 0.0s
    => [internal] load .dockerignore 0.0s
    => => transferring context: 2B 0.0s
    => [1/5] FROM Docker Hub Container Image Library | App Containerization 0.0s
    => [internal] load build context 0.0s
    => => transferring context: 157B 0.0s
    => CACHED [2/5] RUN sed -i “s/Listen 80/Listen 8080/g” /usr/local/apache2/conf/httpd.conf 0.0s
    => CACHED [3/5] COPY certs/server.crt /usr/local/apache2/conf/server.crt 0.0s
    => CACHED [4/5] COPY certs/server.key /usr/local/apache2/conf/server.key 0.0s
    => CACHED [5/5] COPY html/index.html /usr/local/apache2/htdocs/ 0.0s
    => exporting to image 0.0s
    => => exporting layers 0.0s
    => => writing image sha256:a71abf23fcb477768d250bd991ef2c1b6877cefc4d23c23be83d930402dae9 0.0s
    => => naming to Docker Hub Container Image Library | App Containerization 0.0s
    [steve@stapp02 docker]$ sudo docker run -d --name=httpd:2.4.43
    “docker run” requires at least 1 argument.
    See ‘docker run --help’.

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG…]

Create and run a new container from an image
[steve@stapp02 docker]$ sudo cat /opt/docker/Dockerfile
FROM httpd:2.4.43

RUN sed -i “s/Listen 80/Listen 8080/g” /usr/local/apache2/conf/httpd.conf &&
sed -i ‘/LoadModule\ ssl_module modules/mod_ssl.so/s/^#//g’ /usr/local/apache2/conf/httpd.conf &&
sed -i ‘/LoadModule\ socache_shmcb_module modules/mod_socache_shmcb.so/s/^#//g’ /usr/local/apache2/conf/httpd.conf &&
sed -i ‘/Include\ conf/extra/httpd-ssl.conf/s/^#//g’ /usr/local/apache2/conf/httpd.conf

COPY certs/server.crt /usr/local/apache2/conf/server.crt

COPY certs/server.key /usr/local/apache2/conf/server.key

COPY html/index.html /usr/local/apache2/htdocs/
[steve@stapp02 docker]$

Please tell me which lab this is. Are you doing a 100 Days of Devops lab (if so: which day?) or are you doing a regular KK Engineering lab (topic, level + task name)?

Hello ,

This is 100days devops 45th day question.

Thanks
Kaviya Vadivel

Hi @KaviyaVadivel

It’s working properly on my end. Please try again and share the steps you followed if it still fails.