Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gitlab-runner gitlab-runner
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,506
    • Issues 2,506
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 122
    • Merge requests 122
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • gitlab-runnergitlab-runner
  • Issues
  • #3605
Closed
Open
Issue created Sep 24, 2018 by Steve Azzopardi@steveazzMaintainer

Introduce new docker strategy for build container

Description

The docker executor interactive web terminal #3467 (closed) has some limitation due to the nature of the docker. Right now we are running the build script in the container as ps 1 which means as soon as the script exits the container is stoped as well (behavior of docker). This makes having the terminal connection open after the script has finished quite impossible.

Proposal

Introduce a new life cycle for the docker container that runs that build script to be the same as the kubernetes executor as described below.

graph TD

id1(Create container with deattached tty with shell scriped invoked)-->|Container waiting for commands|id2(Execute the build script)
id2-->id3(Wait for temrinal if any)
id3-->id4(Clean up container)

This allows us to wait for the terminal to disconnect/timeout even after the build script has finished.

Since this is quite a big change to the docker behavior and might break some flow for certain users, a new feature flag in a form of a variable will be introduced DOCKER_STRATEGY (similar to git strategy) wich can take two values either:

  1. attach: The current behavior the docker executor has, this will be the default behavior

  2. exec: Will run the container with a detacched tty instead and the commands are run via exec

Links to related issues and merge requests / references

Main issue that add interactive web terminal for docker executor #3467 (closed)

!1024 (closed)

Documentation

This documentation MR should be clarified once this issue is fixed: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21880

Edited Sep 24, 2018 by Jason Yavorska
Assignee
Assign to
Time tracking