On 5/5/21 4:38 PM, tpdownes@xxxxxxxxx wrote:
> Thanks for posting this since it contained enough information for me
> to follow a hunch. In the cloud, hostnames can get quite long to
> promote uniqueness. I believe a docker hostname exceeding 63
> characters will throw this message even though it would be potentially
> valid in a bare metal linux environment:
> Error response from daemon: OCI runtime create failed:
> container_linux.go:367: starting container process caused:
> process_linux.go:495: container init caused: sethostname: invalid
> argument: unknown
> Error: failed to start containers:
> Posting this for the Google hits. I'll follow up with a proper support
Interesting.Â Is this also a problem with docker_network = host ?
If I mimic what the code is doing and add host networking:
docker create --network host --hostname wcwrbbdtrmtefsjzx1wn1eqz4s1eycnwjq10hqj.7s6mi1uxjiyog98xlj50ms6mi.1uxjiyog98xlj50ms6mi1uxjiyog98xlj50m python:latest
docker start $OUTPUT_OF_FIRST_COMMAND
I get the same error (on macOS). Since it's enforcing a 63 character limit, I think docker wants a short hostname for --hostname and a domain for --domainname. But MACHINE is the fully qualified name. On top of all that, I'd give a little consideration to the objective. If it's just to make an interactive shell prompt look pretty, maybe setting $PS1 would suffice?
Anyhow, there's a ticket and I'd like to avoid troubleshooting in two places. The obvious solution (shortening the hostname) works fine for now.