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