Docker engine api create container with privileged mode

279 Views Asked by At

I'm using docker engine api to build image and then create and run container. What I need is run container with --privileged flag. But I couldn't see anything in docker engine api reference doc.

https://docs.docker.com/engine/api/v1.40/#operation/ContainerCreate

const createContainerRes = await axios({
      method: 'post',
      url: 'http://localhost:2375/containers/create',
      headers: {
        'content-type': 'application/json',
      },
      data: {
        Image: imageName,
        HostConfig: {
          PortBindings: {
            '8333/tcp': [{ HostPort: port }],
          },
        },
      },
    })
      .then(res => {
        return res;
      })
      .catch(err => {
        resolve({ message: 'Error' });
      });

How can I start container with privileged flag with docker engine api ?

0

There are 0 best solutions below