TFS workspace with Jenkins Docker container

So I have a Jenkins master container ali_jenkins_m setup which I spin up using a data volume container ali_jenkins_data for storing the Jenkins data.

docker run -p 8080:8080 -p 50000:50000 --name ali_jenknins_master --volumes-from ali_jenkins_data -d ali_jenkins_m

I have setup a TFS plugin and mapped one of our TFS branches to pull the code into Jenkins and build. Everything worked well until I removed my jenkins master container ali_jenkins_m and then recreated it. When recreating I still used the data volume container ali_jenkins_data. All my data has persisted as expected but I am running into issues building from TFS in Jenkins.

  • How to run a docker container as a daemon starting the rails project built inside?
  • error: unexpected end of file (expecting “do”) for shell script in Dockerfile
  • Debug PHP cli application inside docker with PhpStorm
  • Container technologies: docker, rkt, orchestration, kubernetes, GKE and AWS Container Service
  • Nginx doesn't run with my dockers containers
  • Getting a “A blocking operation was interrupted by a call to WSACancelBlockingCall” error when consuming Shipyard API using RestSharp
  • The error I get is:

      Creating workspace 'HUDSON-MCA Continuous Development Build-MASTER' owned by 'DOMAIN\tfsbuild'...
    FATAL: com.microsoft.tfs.core.exceptions.TECoreException: The workspace HUDSON-Development Build-MASTER;tfsbuild already exists on computer **a4d8cdb6981d**.
    

    The a4d8cdb6981d is the container ID of the ali_jenkins_m that I removed. My new conatiner ali_jenkins_m has a new container id. I looked around everywhere on the mount to figure out what needs to be changed to make this work.

    Any pointers will be appreciated.

  • How to change express.js microservice application for ecs auto scaling
  • Docker API call returns “server gave HTTP response to HTTPS client”
  • Docker swarm mode load balancing not working as described
  • Can I Run docker on linux mint 13? [closed]
  • Unjustified increase of the image layers after ADD . sentences
  • Access Docker daemon Remote api on Docker for Mac
  • 2 Solutions collect form web for “TFS workspace with Jenkins Docker container”

    So, this was a problem with TFS and nothing to do with Docker or Jenkins. I solved this problem by running this command.

     tf workspace /delete /server:http://abc.xyz.eee:8080/tfs/IntlSysDev "HUDSON-MCA Continuous Development Build-MASTER";tfsbuild
    

    Another way, we solved this problem was to use a -h option to specify a hostname when running the docker run command. So from above my docker run command now looks like this:

    docker run -p 8080:8080 -p 50000:50000 -h jenkinsali --name ali_jenknins_master --volumes-from ali_jenkins_data -d ali_jenkins_m
    

    This was a better way to do it. Now we dont need to run the tf workspace /delete command every time I recreated the container

    I ran into exactly the same problem (this is a problem with the TFS workspace being mapped to a named computer – which will be the same if you restart a docker container); I deleted the workspace using Team foundation sidekicks which gives you a nice GUI to manipulate workspaces (even other people’s workspaces if you have access)

    1. Open TFS Sidekicks, go to tools –> Workspace sidekick
    2. Specify the workspace details (will be in the hudson error message)
    3. Hit search
    4. Find the offending workspace and remove it.
    5. Kick off your build again, and all should be good!
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.