trying to change hostname as root

Jeff MacDonald 1 Reputation point
2022-03-09T16:31:19.52+00:00

Im trying to change hostname in running container as root.
I dont have permission to.

root# hostname newhostname
hostname: you must be root to change the host name

Im trying to change memory settings in running container as root.
I dont have permission to

root# sysctl -w vm.max_map_count=262144
sysctl: setting key 'vm.max_map_count', ignoring: Read-only file system

which means I cant setup this container properly.

I understand this is because the docker container is not started with --privileged argument. AWS and GCP BOTH allow --privileged containers.

having a linux container without --privileged , is like a windows VM without
Administrator privileges. Kinda makes the container useless.

Is there a work around for this that does NOT involve me starting an ubuntu VM to run my container?
I mean the whole idea of containers is REMOVE the VM layer. If I have to run my container in a VM...there is really no point.

Is there a work around that im not aware of ?

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
401 questions
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
649 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jeff MacDonald 1 Reputation point
    2022-03-11T12:51:10.307+00:00

    azure container support is horrible!!!! doing basic things as root in a linux container is NOT_SUPPORTED.

    see attachment. Azure does not support --privileged containers. AWS and GCP do.

    182269-azure-containers.png

    0 comments No comments