Gitlab-runner + Docker + Windows - Invalid volume specification












4















I'm trying to run my Gitlab CI locally using Gitlab-runner and docker before committing to make sure they work okay. But I'm having some strange issues!



Unfortunately I have no choice but to use windows (I've had success in the past on Linux).



Every time I run a job in powershell:



C:/Gitlab-runner/gitlab-runner exec docker npm



I get an error:



Job failed (system failure): Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/Lewsmith/api:C:/Users/Lewsmith/api:ro' (executor_docker.go:921:0s)



I've tried setting docker volumes (nemerous combinations) and builds-dir:



C:/Gitlab-runner/gitlab-runner exec docker --builds-dir /builds --docker-privileged --docker-volumes "/builds:C:/Gitlab-runner/builds" npm



That fails with Error response from daemon: invalid mode: /Gitlab-runner/builds because of the colon after the C..



Can anyone point me in the right direction as I'm stumped?



Using gitlab-runner version 11.5.0










share|improve this question























  • Are you using the gitlab-runner shell executor?

    – Rekovni
    Nov 26 '18 at 13:26











  • @Rekovni I'm using the docker executor. Shell executor works okay for jobs that run npm install and linter, but I have a test job that requires a postgres service. Services don't work with shell executors.

    – Lewsmith
    Nov 26 '18 at 13:42
















4















I'm trying to run my Gitlab CI locally using Gitlab-runner and docker before committing to make sure they work okay. But I'm having some strange issues!



Unfortunately I have no choice but to use windows (I've had success in the past on Linux).



Every time I run a job in powershell:



C:/Gitlab-runner/gitlab-runner exec docker npm



I get an error:



Job failed (system failure): Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/Lewsmith/api:C:/Users/Lewsmith/api:ro' (executor_docker.go:921:0s)



I've tried setting docker volumes (nemerous combinations) and builds-dir:



C:/Gitlab-runner/gitlab-runner exec docker --builds-dir /builds --docker-privileged --docker-volumes "/builds:C:/Gitlab-runner/builds" npm



That fails with Error response from daemon: invalid mode: /Gitlab-runner/builds because of the colon after the C..



Can anyone point me in the right direction as I'm stumped?



Using gitlab-runner version 11.5.0










share|improve this question























  • Are you using the gitlab-runner shell executor?

    – Rekovni
    Nov 26 '18 at 13:26











  • @Rekovni I'm using the docker executor. Shell executor works okay for jobs that run npm install and linter, but I have a test job that requires a postgres service. Services don't work with shell executors.

    – Lewsmith
    Nov 26 '18 at 13:42














4












4








4


2






I'm trying to run my Gitlab CI locally using Gitlab-runner and docker before committing to make sure they work okay. But I'm having some strange issues!



Unfortunately I have no choice but to use windows (I've had success in the past on Linux).



Every time I run a job in powershell:



C:/Gitlab-runner/gitlab-runner exec docker npm



I get an error:



Job failed (system failure): Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/Lewsmith/api:C:/Users/Lewsmith/api:ro' (executor_docker.go:921:0s)



I've tried setting docker volumes (nemerous combinations) and builds-dir:



C:/Gitlab-runner/gitlab-runner exec docker --builds-dir /builds --docker-privileged --docker-volumes "/builds:C:/Gitlab-runner/builds" npm



That fails with Error response from daemon: invalid mode: /Gitlab-runner/builds because of the colon after the C..



Can anyone point me in the right direction as I'm stumped?



Using gitlab-runner version 11.5.0










share|improve this question














I'm trying to run my Gitlab CI locally using Gitlab-runner and docker before committing to make sure they work okay. But I'm having some strange issues!



Unfortunately I have no choice but to use windows (I've had success in the past on Linux).



Every time I run a job in powershell:



C:/Gitlab-runner/gitlab-runner exec docker npm



I get an error:



Job failed (system failure): Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/Lewsmith/api:C:/Users/Lewsmith/api:ro' (executor_docker.go:921:0s)



I've tried setting docker volumes (nemerous combinations) and builds-dir:



C:/Gitlab-runner/gitlab-runner exec docker --builds-dir /builds --docker-privileged --docker-volumes "/builds:C:/Gitlab-runner/builds" npm



That fails with Error response from daemon: invalid mode: /Gitlab-runner/builds because of the colon after the C..



Can anyone point me in the right direction as I'm stumped?



Using gitlab-runner version 11.5.0







docker gitlab gitlab-ci gitlab-ci-runner






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 25 '18 at 22:06









LewsmithLewsmith

1009




1009













  • Are you using the gitlab-runner shell executor?

    – Rekovni
    Nov 26 '18 at 13:26











  • @Rekovni I'm using the docker executor. Shell executor works okay for jobs that run npm install and linter, but I have a test job that requires a postgres service. Services don't work with shell executors.

    – Lewsmith
    Nov 26 '18 at 13:42



















  • Are you using the gitlab-runner shell executor?

    – Rekovni
    Nov 26 '18 at 13:26











  • @Rekovni I'm using the docker executor. Shell executor works okay for jobs that run npm install and linter, but I have a test job that requires a postgres service. Services don't work with shell executors.

    – Lewsmith
    Nov 26 '18 at 13:42

















Are you using the gitlab-runner shell executor?

– Rekovni
Nov 26 '18 at 13:26





Are you using the gitlab-runner shell executor?

– Rekovni
Nov 26 '18 at 13:26













@Rekovni I'm using the docker executor. Shell executor works okay for jobs that run npm install and linter, but I have a test job that requires a postgres service. Services don't work with shell executors.

– Lewsmith
Nov 26 '18 at 13:42





@Rekovni I'm using the docker executor. Shell executor works okay for jobs that run npm install and linter, but I have a test job that requires a postgres service. Services don't work with shell executors.

– Lewsmith
Nov 26 '18 at 13:42












1 Answer
1






active

oldest

votes


















1














At the moment there isn't official support for the Docker executor in Windows. A work in progress issue is open at the moment, and it looks like some people have managed to get a windows docker executor working to varying success in that merge request.



This specific comment shows how they've managed to get it setup using a custom built gitlab-runner. I'm unsure how this will work with Services however, so YMMV.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53472481%2fgitlab-runner-docker-windows-invalid-volume-specification%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    At the moment there isn't official support for the Docker executor in Windows. A work in progress issue is open at the moment, and it looks like some people have managed to get a windows docker executor working to varying success in that merge request.



    This specific comment shows how they've managed to get it setup using a custom built gitlab-runner. I'm unsure how this will work with Services however, so YMMV.






    share|improve this answer




























      1














      At the moment there isn't official support for the Docker executor in Windows. A work in progress issue is open at the moment, and it looks like some people have managed to get a windows docker executor working to varying success in that merge request.



      This specific comment shows how they've managed to get it setup using a custom built gitlab-runner. I'm unsure how this will work with Services however, so YMMV.






      share|improve this answer


























        1












        1








        1







        At the moment there isn't official support for the Docker executor in Windows. A work in progress issue is open at the moment, and it looks like some people have managed to get a windows docker executor working to varying success in that merge request.



        This specific comment shows how they've managed to get it setup using a custom built gitlab-runner. I'm unsure how this will work with Services however, so YMMV.






        share|improve this answer













        At the moment there isn't official support for the Docker executor in Windows. A work in progress issue is open at the moment, and it looks like some people have managed to get a windows docker executor working to varying success in that merge request.



        This specific comment shows how they've managed to get it setup using a custom built gitlab-runner. I'm unsure how this will work with Services however, so YMMV.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 26 '18 at 13:58









        RekovniRekovni

        1,1701531




        1,1701531
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53472481%2fgitlab-runner-docker-windows-invalid-volume-specification%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Create new schema in PostgreSQL using DBeaver

            Deepest pit of an array with Javascript: test on Codility

            Costa Masnaga