Added dockerfile key support

Fixes #486
This commit will add `dockerfilepath` key under Dockerstratergy in buildconfig.
dockerfilepath allow us to use dockerfiles which are named different than `Dockerfile` which are placed in context directory.

for example, for a docker-compose file:

```
version: "2"
services:
    foo:
        build:
            context: "./build"
            dockerfile: "Dockerfile-alternate"
        command: "sleep 3600"
```
Resulting buildconfig will be:

```
apiVersion: v1
kind: BuildConfig
...
...
  strategy:
    dockerStrategy:
      dockerfilePath: Dockerfile-alternate
    type: Docker
...
...
```
This commit is contained in:
Suraj Narwade
2017-03-22 17:49:26 +05:30
parent fba87faa16
commit ec897ef50f
4 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -76,7 +76,6 @@ func checkUnsupportedKey(composeProject *project.Project) []string {
"Uts": false,
"ReadOnly": false,
"Ulimits": false,
"Dockerfile": false,
"Net": false,
"Sysctls": false,
"Networks": false, // there are special checks for Network in checkUnsupportedKey function
@@ -321,6 +320,7 @@ func (c *Compose) LoadFile(files []string) (kobject.KomposeObject, error) {
serviceConfig.ContainerName = composeServiceConfig.ContainerName
serviceConfig.Command = composeServiceConfig.Entrypoint
serviceConfig.Args = composeServiceConfig.Command
serviceConfig.Dockerfile = composeServiceConfig.Build.Dockerfile
envs := loadEnvVars(composeServiceConfig.Environment)
serviceConfig.Environment = envs