I am trying to build a Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get install –y apache2
RUN apt-get install –y apache2-utils
RUN apt-get clean
EXPOSE 80
CMD [“apache2ctl”, “-D”, “FOREGROUND”]
when i am running this command docker build –t=”mywebserver” .
I am getting below provided error in console
E: Unable to locate package –y
The command '/bin/sh -c apt-get install –y apache2' returned a non-zero code: 100
I'm not sure how, but I think you're using an en dash instead of a hyphen in front of your y.
You want -y
rather than –y
If you look closely there's a subtle difference.
The Dockerfile
looks fine so could be something to do with a proxy/firewall.
I would try the following:
FROM ubuntu
RUN apt-get update
Run with docker build --no-cache -t mywebserver
and see if it performs the update without issues. If not then I would suggest looking at setting http/https
proxy with ENV
inside the dockerfile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With