Break up that RUN line into a few different ones so that you can figure out which command is returning error code 4. Once you know that, you should be able to troubleshoot it a bit better.
Hi Jeff, Im Break Up and recive error in command wget, when running command out the docker the command wget is OK, maybe is a bug in docker with varibles, check
Wget Out docker
[root@laplinux8 tmp]# ls -ls /tmp/IM.zip
ls: cannot access /tmp/IM.zip: No such file or directory
[root@laplinux8 tmp]# wget -q http://laplinux8/sw/Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip -O /tmp/IM.zip
[root@laplinux8 tmp]# ls -ls /tmp/IM.zip
132688 -rw-r–r-- 1 root root 135872014 Mar 21 16:08 /tmp/IM.zip
With Docker Buid
[root@laplinux8 install]# docker build --build-arg user=was1 --build-arg group=was1 --build-arg URL=http://laplinux8/sw -t ndtar -f Dockerfile.prereq .
Sending build context to Docker daemon 24.06 kB
Step 1 : FROM centos
—> 778a53015523
Step 2 : MAINTAINER Kavitha Suresh Kumar kavisuresh@in.ibm.com
—> Using cache
—> 11611cf24fde
Step 3 : RUN yum install -y sh bash unzip wget tar
—> Using cache
—> 59b318521e7e
Step 4 : ARG user=wassop85
—> Using cache
—> a68184c2a8be
Step 5 : ARG group=wassop85
—> Using cache
—> 49d6ca74b772
Step 6 : RUN groupadd $group && useradd $user -g $group -m && chown -R $user:$group /var /opt /tmp
—> Using cache
—> 5f5346acc87b
Step 7 : USER $user
—> Using cache
—> d65a40b118e6
Step 8 : ARG URL
—> Using cache
—> 77c1e15d0c84
Step 9 : RUN wget -q $URL/Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip -O /tmp/IM.zip
—> Running in 6b2ebd3589dd
The command ‘/bin/sh -c wget -q $URL/Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip -O /tmp/IM.zip’ returned a non-zero code: 4
[root@laplinux8 install]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6b2ebd3589dd 77c1e15d0c84 "/bin/sh -c 'wget -q " 10 seconds ago Exited (4) 7 seconds ago tender_engelbart
I face the same issue(returned with non-zero code 4 i.e. network failure) with wget .
Can you please let me know how to open the port in FW i.e. what command needs to be added to my docker file(I am getting this problem when building Dockerfile).