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.

  • Can not pull docker image from private repo when using Minikube
  • Is there a formula for calculating the overhead of a Docker container?
  • attempting to recreate supervisor tutorial in docker, running into error (permissioning?)
  • How do I use docker to run a gitlab-runner for a gitlab-hosted project?
  • coreos - get docker container name by PID
  • Is 2 the minimum number of instances to properly deploy a container on AWS?
  • 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.

  • Running GUI in docker (no ssh, no VNC)
  • docker redis -Can't open the log file: No such file or directory
  • Restrict Docker exposed port from only specific IP adresses
  • How to select Docker host to use with new Eclipse Liberty WDT tools
  • Passing environmental variables when deploying docker to remote host
  • ubuntu 14.04 SuperDesk Raven not configured (logging is disabled)
  • 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.