Singapore Flyer

Wednesday, June 13, 2018

failed to link /usr/share/man/man1/java.1 -> /etc/alternatives/java.1: No such file or directory

Error : failed to link /usr/share/man/man1/java.1 -> /etc/alternatives/java.1: No such file or directory

I am trying to install a java rpm in a docker container via dockerfile. I got the above error while installing rpm.

The reason is its a small container that cause the error. A workaround for getting out of this error is to create a directory before the rpm installation in your dockerfile.

mkdir -p /usr/share/man/man1

This works for me :)

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Getting the following error in docker:

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Issue fix:

1. cd /etc/systemd/system/docker.service.d  (If not present, create this directory structure)
2. Create a file http-proxy.conf in that path and update the following
Environment="HTTP_PROXY=http://yourproxy.com:80/"
Environment="NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"
3. systemctl daemon-reload
4. systemctl show --property Environment docker
Environment=HTTP_PROXY=http://yourproxy.com:80/
5. systemctl restart docker

This fixed my issue. I am using OEL7.5