mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-10 17:06:47 +00:00
Set the hostname for containers and functions
By setting the hostname, the container will resolve to its name instead of just localhost. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
parent
27ba86fb52
commit
6c0f91e810
@ -147,6 +147,7 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container
|
||||
containerd.WithSnapshotter(snapshotter),
|
||||
containerd.WithNewSnapshot(name+"-snapshot", image),
|
||||
containerd.WithNewSpec(oci.WithImageConfig(image),
|
||||
oci.WithHostname(name),
|
||||
oci.WithCapabilities([]string{"CAP_NET_RAW"}),
|
||||
oci.WithMounts(mounts),
|
||||
oci.WithEnv(envs),
|
||||
|
@ -172,6 +172,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
||||
containerd.WithImage(image),
|
||||
containerd.WithNewSnapshot(svc.Name+"-snapshot", image),
|
||||
containerd.WithNewSpec(oci.WithImageConfig(image),
|
||||
oci.WithHostname(svc.Name),
|
||||
withUserOrDefault(svc.User),
|
||||
oci.WithCapabilities(svc.Caps),
|
||||
oci.WithMounts(mounts),
|
||||
|
Loading…
x
Reference in New Issue
Block a user