Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker building fails: returned a non-zero code: 1

Dockerfile1

FROM ubuntu:latest
MAINTAINER ME
RUN apt-get update
RUN apt-get update && apt-get install -y net-tools \
&& apt-get install inetutils-traceroute \
&& apt-get install iputils-ping \
&& apt-get install xinetd telnetd

Dockerfile2

FROM ubuntu:latest
MAINTAINER ME
RUN apt-get update
RUN apt-get update && apt-get install -y net-tools
RUN apt-get update && apt-get install inetutils-traceroute
RUN apt-get update apt-get install iputils-ping
RUN apt-get install xinetd telnetd

Dockerfile3

FROM ubuntu:latest
MAINTAINER ME
RUN apt-get update
RUN apt-get install inetutils-traceroute
RUN apt-get install -y net-tools
RUN apt-get update apt-get install iputils-ping
RUN apt-get install xinetd telnetd

I tried all the above flavors of my dockerfile but every time I get the same error :

The command '/bin/sh -c apt-get update && apt-get install -y net-tools && apt-get install inetutils-traceroute && apt-get install iputils-ping && apt-get install xinetd telnetd' returned a non-zero code: 1
like image 345
N.. Avatar asked Mar 07 '26 06:03

N..


1 Answers

Someone posted an answer and deleted it before I could accept it. But here it is -

FROM ubuntu:latest
MAINTAINER ME

RUN apt-get update && apt-get install -y \
net-tools inetutils-traceroute \
iputils-ping xinetd telnetd

This works!!

like image 95
N.. Avatar answered Mar 08 '26 20:03

N..