From 10c1a02b288bf873f9e7da7c47ed880899e4bf12 Mon Sep 17 00:00:00 2001 From: Nuno do Carmo Date: Tue, 19 Feb 2019 14:37:04 +0100 Subject: [PATCH] Added variables - added bundle variables (after porter [PR #162](https://github.com/deislabs/porter/pull/162) - full path to commands used --- porter.yaml | 60 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/porter.yaml b/porter.yaml index 04f21b1..6168b6f 100755 --- a/porter.yaml +++ b/porter.yaml @@ -6,28 +6,55 @@ mixins: - exec name: WSLDISTRO -version: 0.1.0 +version: 0.2.0 description: "Build WSL distros from Docker containers" -invocationImage: wsl-distro:latest +invocationImage: nunix/wsl-distro:latest + +parameters: + - name: DISTRO_IMAGE + type: string + default: "alpine" + + - name: DISTRO_NAME + type: string + default: "wslcustom" + + - name: DISTRO_PATH + type: string + default: "/mnt/c/github/wslcustom" + + - name: DISTRO_SOURCE + type: string + default: "/mnt/c/github/wslcustom.tar" install: + - description: "Creates a container based on the image" + exec: + command: /usr/local/docker/docker + arguments: + - run + - -d + - --name + - source: bundle.parameters.DISTRO_NAME + - source: bundle.parameters.DISTRO_IMAGE + - description: "Export the Docker container to TAR file" exec: - command: "/mnt/c/Program Files/Docker/Docker/Resources/bin/docker.exe" + command: /usr/local/docker/docker arguments: - export - --output - - ./alpine.tar - - alpine + - source: bundle.parameters.DISTRO_SOURCE + - source: bundle.parameters.DISTRO_NAME - description: "Install a new WSL distro" exec: - command: /mnt/c/WINDOWS/system32/wsl.exe + command: /mnt/c/Windows/System32/wsl.exe arguments: - --import - - "wslcustom" - - "./wslcustom" - - "./alpine.tar" + - source: bundle.parameters.DISTRO_NAME + - source: bundle.parameters.DISTRO_PATH + - source: bundle.parameters.DISTRO_SOURCE uninstall: - description: "Uninstall a WSL distro" @@ -35,20 +62,7 @@ uninstall: command: /mnt/c/WINDOWS/system32/wsl.exe arguments: - --unregister - - "wslcustom" - -parameters: - - name: distro_name - type: string - default: wslcustom - - - name: distro_path - type: string - default: "/mnt/c/github/wslcustom" - - - name: distro_source - type: string - default: "/mnt/c/github/ubuntu1904.tar" + - source: bundle.parameters.DISTRO_NAME #dependencies: # - name: mysql