@@ -53,14 +53,14 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
5353 "com.example.foo" : "bar" ,
5454 },
5555 Build : & types.BuildConfig {
56- Context : "./ dir" ,
56+ Context : filepath . Join ( workingDir , " dir") ,
5757 Dockerfile : "Dockerfile" ,
5858 Args : map [string ]* string {"foo" : strPtr ("bar" )},
5959 SSH : []types.SSHKey {{ID : "default" , Path : "" }},
6060 Target : "foo" ,
6161 Network : "foo" ,
6262 CacheFrom : []string {"foo" , "bar" },
63- AdditionalContexts : types.Mapping {"foo" : "/ bar" },
63+ AdditionalContexts : types.Mapping {"foo" : filepath . Join ( workingDir , " bar") },
6464 Labels : map [string ]string {"FOO" : "BAR" },
6565 Secrets : []types.ServiceSecretConfig {
6666 {
@@ -439,6 +439,7 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
439439 {
440440 Name : "bar" ,
441441 Build : & types.BuildConfig {
442+ Context : workingDir ,
442443 DockerfileInline : "FROM alpine\n RUN echo \" hello\" > /world.txt\n " ,
443444 },
444445 Environment : types.MappingWithEquals {},
@@ -599,14 +600,15 @@ func fullExampleYAML(workingDir, homeDir string) string {
599600services:
600601 bar:
601602 build:
603+ context: %s
602604 dockerfile_inline: |
603605 FROM alpine
604606 RUN echo "hello" > /world.txt
605607 foo:
606608 annotations:
607609 com.example.foo: bar
608610 build:
609- context: ./dir
611+ context: %s
610612 dockerfile: Dockerfile
611613 args:
612614 foo: bar
@@ -618,7 +620,7 @@ services:
618620 - foo
619621 - bar
620622 additional_contexts:
621- foo: /bar
623+ foo: %s
622624 network: foo
623625 target: foo
624626 secrets:
@@ -1039,6 +1041,9 @@ x-nested:
10391041 bar: baz
10401042 foo: bar
10411043` ,
1044+ workingDir ,
1045+ filepath .Join (workingDir , "dir" ),
1046+ filepath .Join (workingDir , "bar" ),
10421047 filepath .Join (workingDir , "example1.env" ),
10431048 filepath .Join (workingDir , "example2.env" ),
10441049 workingDir ,
@@ -1150,6 +1155,7 @@ func fullExampleJSON(workingDir, homeDir string) string {
11501155 "services": {
11511156 "bar": {
11521157 "build": {
1158+ "context": "%s",
11531159 "dockerfile_inline": "FROM alpine\nRUN echo \"hello\" \u003e /world.txt\n"
11541160 },
11551161 "command": null,
@@ -1160,7 +1166,7 @@ func fullExampleJSON(workingDir, homeDir string) string {
11601166 "com.example.foo": "bar"
11611167 },
11621168 "build": {
1163- "context": "./dir ",
1169+ "context": "%s ",
11641170 "dockerfile": "Dockerfile",
11651171 "args": {
11661172 "foo": "bar"
@@ -1176,7 +1182,7 @@ func fullExampleJSON(workingDir, homeDir string) string {
11761182 "bar"
11771183 ],
11781184 "additional_contexts": {
1179- "foo": "/bar "
1185+ "foo": "%s "
11801186 },
11811187 "network": "foo",
11821188 "target": "foo",
@@ -1686,6 +1692,9 @@ func fullExampleJSON(workingDir, homeDir string) string {
16861692 toPath (workingDir , "config_data" ),
16871693 toPath (homeDir , "config_data" ),
16881694 toPath (workingDir , "secret_data" ),
1695+ toPath (workingDir ),
1696+ toPath (workingDir , "dir" ),
1697+ toPath (workingDir , "bar" ),
16891698 toPath (workingDir , "example1.env" ),
16901699 toPath (workingDir , "example2.env" ),
16911700 toPath (workingDir ),
0 commit comments