Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit df7cf18

Browse files
authored
Merge pull request #395 from joshwget/stop-signal
Add stop_signal
2 parents fbdac0a + 45e6086 commit df7cf18

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

config/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type ServiceConfigV1 struct {
5656
ShmSize yaml.StringorInt `yaml:"shm_size,omitempty"`
5757
StdinOpen bool `yaml:"stdin_open,omitempty"`
5858
SecurityOpt []string `yaml:"security_opt,omitempty"`
59+
StopSignal string `yaml:"stop_signal,omitempty"`
5960
Tty bool `yaml:"tty,omitempty"`
6061
User string `yaml:"user,omitempty"`
6162
VolumeDriver string `yaml:"volume_driver,omitempty"`

docker/service/convert.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ func Convert(c *config.ServiceConfig, ctx project.Context, clientFactory compose
167167
WorkingDir: c.WorkingDir,
168168
Volumes: toMap(Filter(vols, isVolume)),
169169
MacAddress: c.MacAddress,
170+
StopSignal: c.StopSignal,
170171
}
171172

172173
ulimits := []*units.Ulimit{}

docker/service/convert_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,14 @@ func TestParseLabels(t *testing.T) {
7979
assert.Equal(t, yaml.Command{bashCmd}, sc.Entrypoint)
8080
assert.Equal(t, []string{"less"}, []string(cfg.Entrypoint))
8181
}
82+
83+
func TestStopSignal(t *testing.T) {
84+
ctx := &ctx.Context{}
85+
sc := &config.ServiceConfig{
86+
StopSignal: "SIGTERM",
87+
}
88+
cfg, _, err := Convert(sc, ctx.Context, nil)
89+
assert.Nil(t, err)
90+
91+
assert.Equal(t, "SIGTERM", cfg.StopSignal)
92+
}

0 commit comments

Comments
 (0)