Error in containers lab

Hi Team,

in the first question of the below url, while building docker image I am getting below error.

https://kodekloud.com/topic/cncf-assessment/

root@controlplane ~ ➜ cd nginx

root@controlplane ~/nginx ➜ ls -l
total 8
-rw-rw-rw- 1 root root 81 Aug 31 11:59 Dockerfile
-rw-rw-rw- 1 root root 2624 Aug 31 11:59 nginx.conf

root@controlplane ~/nginx ➜ docker build -t kodekloud/nginx:custom .
Sending build context to Docker daemon 5.632kB
Step 1/3 : FROM nginx:latest
—> 1403e55ab369
Step 2/3 : COPY nginx.conf /etc/nginx/nginx.conf
error creating overlay mount to /var/lib/docker/overlay2/adaf5ade835c8dba56b459f6437abc82160abf388969c71e87479e6d38632855/merged: invalid argument

It’s broken!
A ticket has been raised to get it fixed.

Thanks

@puneet_a_007 ,

Delete COPY line and it will build fine.


root@controlplane ~ ➜  cd nginx/

root@controlplane ~/nginx ➜  sed -i -s '/^COPY/d' Dockerfile 

root@controlplane ~/nginx ➜  cat Dockerfile 
FROM nginx:latest
RUN ["./usr/sbin/nginx"]

root@controlplane ~/nginx ➜  docker build -t kodekloud/nginx:custom .
Sending build context to Docker daemon  5.632kB
Step 1/2 : FROM nginx:latest
 ---> 1403e55ab369
Step 2/2 : RUN ["./usr/sbin/nginx"]
 ---> Running in 0f011922b767
2023/09/19 05:44:44 [notice] 1#1: using the "epoll" event method
2023/09/19 05:44:44 [notice] 1#1: nginx/1.23.3
2023/09/19 05:44:44 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
2023/09/19 05:44:44 [notice] 1#1: OS: Linux 5.4.0-1106-gcp
2023/09/19 05:44:44 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2023/09/19 05:44:44 [notice] 57#57: start worker processes
2023/09/19 05:44:44 [notice] 57#57: start worker process 58
2023/09/19 05:44:44 [notice] 57#57: start worker process 59
2023/09/19 05:44:44 [notice] 57#57: start worker process 60
2023/09/19 05:44:44 [notice] 57#57: start worker process 61
2023/09/19 05:44:44 [notice] 57#57: start worker process 62
2023/09/19 05:44:44 [notice] 57#57: start worker process 63
2023/09/19 05:44:44 [notice] 57#57: start worker process 64
2023/09/19 05:44:44 [notice] 57#57: start worker process 65
2023/09/19 05:44:44 [notice] 57#57: start worker process 66
2023/09/19 05:44:44 [notice] 57#57: start worker process 67
2023/09/19 05:44:44 [notice] 57#57: start worker process 68
2023/09/19 05:44:44 [notice] 57#57: start worker process 69
2023/09/19 05:44:44 [notice] 57#57: start worker process 70
2023/09/19 05:44:44 [notice] 57#57: start worker process 71
2023/09/19 05:44:44 [notice] 57#57: start worker process 72
2023/09/19 05:44:44 [notice] 57#57: start worker process 73
2023/09/19 05:44:44 [notice] 57#57: start worker process 74
2023/09/19 05:44:44 [notice] 57#57: start worker process 75
2023/09/19 05:44:44 [notice] 57#57: start worker process 76
2023/09/19 05:44:44 [notice] 57#57: start worker process 77
2023/09/19 05:44:44 [notice] 57#57: start worker process 78
2023/09/19 05:44:44 [notice] 57#57: start worker process 79
2023/09/19 05:44:44 [notice] 57#57: start worker process 80
2023/09/19 05:44:44 [notice] 57#57: start worker process 81
Removing intermediate container 0f011922b767
 ---> 3925b8560d7c
Successfully built 3925b8560d7c
Successfully tagged kodekloud/nginx:custom

root@controlplane ~/nginx ➜  docker images
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
kodekloud/nginx                      custom              3925b8560d7c        12 seconds ago      142MB
busybox                              latest              66ba00ad3de8        8 months ago        4.87MB
nginx                                latest              1403e55ab369        9 months ago        142MB
nginx                                alpine              1e415454686a        9 months ago        40.7MB
k8s.gcr.io/kube-apiserver            v1.23.0             e6bf5ddd4098        21 months ago       135MB
k8s.gcr.io/kube-controller-manager   v1.23.0             37c6aeb3663b        21 months ago       125MB
k8s.gcr.io/kube-proxy                v1.23.0             e03484a90585        21 months ago       112MB
k8s.gcr.io/kube-scheduler            v1.23.0             56c5af1d00b5        21 months ago       53.5MB
k8s.gcr.io/etcd                      3.5.1-0             25f8c7f3da61        22 months ago       293MB
k8s.gcr.io/coredns/coredns           v1.8.6              a4ca41631cc7        23 months ago       46.8MB
k8s.gcr.io/pause                     3.6                 6270bb605e12        2 years ago         683kB
quay.io/coreos/flannel               v0.13.1-rc1         f03a23d55e57        2 years ago         64.6MB
quay.io/coreos/flannel               v0.12.0-amd64       4e9f801d2217        3 years ago         52.8MB
kodekloud/fluent-ui-running          latest              bd30270a8b9a        4 years ago         969MB

root@controlplane ~/nginx ➜  

Thanks a lot for your help ! This helped a lot !

@tsanghan @puneet_a_007

Deleting the copy line whilst it may work isn’t in the spirit of the question! Luckily the validation script does not assert that the config file is correctly present
Either way, the lab has now been fixed.