SlideShare a Scribd company logo
1 of 27
Download to read offline
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Hackathon time! Join us for the Docker AI/ML Hackathon now through November 7th. Sign up now ✕
Products Developers Pricing Blog About
Us Partners Sign In Get
Started
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Ajeet Singh Raina
Kamesh Sampath
Continuous Integration (CI) is a key element of cloud native application development. With containers forming the
Bring Continuous Integration to
Your Laptop With the Drone CI
Docker Extension
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
foundation of cloud-native architectures, developers need to integrate their version control system with a CI tool.
There’s a myth that continuous integration needs a cloud-based infrastructure. Even though CI makes sense for
production releases, developers need to build and test the pipeline before they can share it with their team — or have the
ability to perform the continuous integration (CI) on their laptop. Is that really possible today?
Introducing the Drone CI pipeline
An open-source project called Drone CI makes that a reality. With over 25,700 GitHub stars and 300-plus contributors,
Drone is a cloud-native, self-service CI platform. Drone CI offers a mature, container-based system that leverages the
scaling and fault-tolerance characteristics of cloud-native architectures. It helps you build container-friendly pipelines
that are simple, decoupled, and declarative.
Drone is a container based pipeline engine that lets you run any existing containers as part of your pipeline or package
your build logic into reusable containers called Drone Plugins.
Drone plugins are configurable based on the need and that allows distributing the container within your organization or to
the community in general.
Running Drone CI pipelines from Docker
Desktop
For a developer working with decentralized tools, the task of building and deploying microservice applications can be
monumental. It’s tricky to install, manage, and use these apps in those environments. That’s where Docker Extensions
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
come in. With Docker Extensions, developer tools are integrated right into Docker Desktop — giving you streamlined
management workflows. It’s easier to optimize and transform your development processes.
The Drone CI extension for Docker Desktop brings CI to development machines. You can now import Drone CI pipelines
into Docker Desktop and run them locally. You can also run specific steps of a pipeline, monitor execution results, and
inspect logs.
Setting up a Drone CI pipeline
In this guide, you’ll learn how to set up a Drone CI pipeline from scratch on Docker Desktop.
First, you’ll install the Drone CI Extension within Docker Desktop. Second, you’ll learn how to discover Drone pipelines.
Third, you’ll see how to open a Drone pipeline on Visual Studio Code. Lastly, you’ll discover how to run CI pipelines in
trusted mode, which grants them elevated privileges on the host machine. Let’s jump in.
Prerequisites
You’ll need to download Docker Desktop 4.8 or later before getting started. Make sure to choose the correct version for
your OS and then install it.
Next, hop into Docker Desktop and confirm that the Docker Extensions feature is enabled. Click the Settings gear >
Extensions tab > check the “Enable Docker Extensions” box.
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Installing the Drone CI Docker extension
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Drone CI isn’t currently available on the Extensions Marketplace, so you’ll have to download it via the CLI. Launch your
terminal and run the following command to install the Drone CI Extension:
The Drone CI extension will soon appear in the Docker Dashboard’s left sidebar, underneath the Extensions heading:
1 docker extension install drone/drone-ci-docker-extension:latest
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Import Drone pipelines
You can click the “Import Pipelines” option to specify the host filesystem path where your Drone CI pipelines (
drone.yml files) are. If this is your first time with Drone CI pipelines, you can use the examples from our GitHub repo.
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
In the recording above, we’ve used the long-run-demo sample to run a local pipeline that executes a long running sleep
command. This occurs within a Docker container.
0:00 / 0:22
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
You can download this pipeline YAML file from the Drone CI GitHub page.
The file starts with a pipeline object that defines your CI pipeline. The type attribute defines your preferred runtime
while executing that pipeline.
Drone supports numerous runners like docker, kubernetes, and more. The extension only supports docker pipelines
currently.
Each pipeline step spins up a Docker container with the corresponding image defined as part of the step image
attribute.
Each step defines an attribute called commands . This is a list of shell commands that we want to execute as part of the
build. The defined list of commands will be converted into shell script and set as Docker container’s ENTRYPOINT . If any
command (for example, the missing yq command, in this case) returns a non-zero exit code, the pipeline fails and exits.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
kind: pipeline
type: docker
name: sleep-demos
steps:
- name: sleep5
image: busybox
pull: if-not-exists
commands:
- x=0;while [ $x -lt 5 ]; do echo "hello"; sleep 1; x=$((x+1)); done
- name: an error step
image: busybox
pull: if-not-exists
commands:
- yq --help
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Edit your pipeline faster in VS Code via Drone
CI
Visual Studio Code (VS Code) is a lightweight, highly-popular IDE. It supports JavaScript, TypeScript, and Node.js. VS
Code also has a rich extensions ecosystem for numerous other languages and runtimes.
Opening your Drone pipeline project in VS Code takes just seconds from within Docker Desktop:
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
This feature helps you quickly view your pipeline and add, edit, or remove steps — then run them from Docker Desktop. It
lets you iterate faster while testing new pipeline changes.
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Running specific steps in the CI pipeline
The Drone CI Extension lets you run individual steps within the CI pipeline at any time. To better understand this
functionality, let’s inspect the following Drone YAML file:
In this example, the first pipeline step defined as sleep5 lets you execute a shell script ( echo “hello” ) for five
seconds and then stop (ignoring an error step ).The video below shows you how to run the specific sleep-demos
stage within the pipeline:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
kind: pipeline
type: docker
name: sleep-demos
steps:
- name: sleep5
image: busybox
pull: if-not-exists
commands:
- x=0;while [ $x -lt 5 ]; do echo "hello"; sleep 1; x=$((x+1)); done
- name: an error step
image: busybox
pull: if-not-exists
commands:
- yq --help
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
0:00 / 0:09
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Running steps in trusted mode
Sometimes, you’re required to run a CI pipeline with elevated privileges. These privileges enable a user to systematically
do more than a standard user. This is similar to how we pass the --privileged=true parameter within a docker run
command.
When you execute docker run --privileged , Docker will permit access to all host devices and set configurations in
AppArmor or SELinux. These settings may grant the container nearly equal access to the host as processes running
outside containers on the host.
Drone’s trusted mode tells your container runtime to run the pipeline containers with elevated privileges on the host
machine. Among other things, trusted mode can help you:
Mount the Docker host socket onto the pipeline container
Mount the host path to the Docker container
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
0:00 / 0:26
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Run pipelines using environment
variable files
The Drone CI Extension lets you define environment variables for individual build steps. You can set these within a
pipeline step. Like docker run provides a way to pass environment variables to running containers, Drone lets you pass
usable environment variables to your build. Consider the following Drone YAML file:
The file starts with a pipeline object that defines your CI pipeline. The type attribute defines your preferred runtime
(Docker, in our case) while executing that pipeline. The platform section helps configure the target OS and architecture
(like arm64 ) and routes the pipeline to the appropriate runner. If unspecified, the system defaults to Linux amd64 .
The steps section defines a series of shell commands. These commands run within a busybox Docker container as
the ENTRYPOINT . As shown, the command prints the environment variables if you’ve declared the following environment
variables in your my-env file:
1
2
3
4
5
6
7
8
9
kind: pipeline
type: docker
name: default
steps:
- name: display environment variables
image: busybox
pull: if-not-exists
commands:
- printenv
1
2
DRONE_DESKTOP_FOO=foo
DRONE_DESKTOP_BAR=bar
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
You can choose your preferred environment file and run the CI pipeline (pictured below):
If you try importing the CI pipeline, you can print every environment variable.
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Run pipelines with secrets files
We use repository secrets to store and manage sensitive information like passwords, tokens, and ssh keys. Storing this
information as a secret is considered safer than storing it within a plain text configuration file.
Note: Drone masks all values used from secrets while printing them to standard output and error.
The Drone CI Extension lets you choose your preferred secrets file and use it within your CI pipeline as shown below:
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Remove pipelines
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
You can remove a CI pipeline in just one step. Select one or more Drone pipelines and remove them by clicking the red
minus (“-”) button on the right side of the Dashboard. This action will only remove the pipelines from Docker Desktop —
without deleting them from your filesystem.
Bulk remove all pipelines
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Remove a single pipeline
Conclusion
Drone is a modern, powerful, container-friendly CI that empowers busy development teams to automate their workflows.
This dramatically shortens building, testing, and release cycles. With a Drone server, development teams can build and
deploy cloud apps. These harness the scaling and fault-tolerance characteristics of cloud-native architectures like
Kubernetes.
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Check out Drone’s documentation to get started with CI on your machine. With the Drone CI extension, developers can
now run their Drone CI pipelines locally as they would in their CI systems.
Want to dive deeper into Docker Extensions? Check out our intro documentation, or discover how to build your own
extensions.
 Docker Desktop, Docker Extensions, Docker Hub
Signing Docker Official Images
Using OpenPubkey
By Jonny Stoten October 13, 2023
Getting Started with JupyterLab
as a Docker Extension
By Marcelo Ochoa October 12, 2023
Security Advisory: High Severity
Curl Vulnerability
By Jonathan Roberts October 5, 2023
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Posted
Sep 20, 2022
Post Tags
Docker Desktop
Docker Extensions
Docker Hub
Categories
Community
Company
Engineering
Products







2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
Products
Docker Personal
Docker Pro
Docker Team
Docker Business
Docker Scout
Desktop vs Docker Engine
Docker Desktop
Docker Hub
Extensions
Secure Software Supply Chain
Container Runtime
Developer Tools
Trusted Content
Docker Product Roadmap
Support
Developers
Docs
Getting Started
Extensions SDK
Community
Open Source
Preview Program
System Status
Pricing
FAQ
Docker Verified Publisher
Partners
Blog
About Us
What is a Container
Why Docker
Events
Swag Store
Newsroom
Careers
Contact Us
Customers
Trademark Guidelines
2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
© 2023 Docker Inc. All rights reserved | Terms of Service | Privacy | Legal Cookies Settings

More Related Content

Similar to Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension _ Docker.pdf

Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdfYogeshwaran R
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Docker, Inc.
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Dockerkanedafromparis
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Developmentmsyukor
 
Shipping to Server and Cloud with Docker
Shipping to Server and Cloud with DockerShipping to Server and Cloud with Docker
Shipping to Server and Cloud with DockerAtlassian
 
Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)MeetupDataScienceRoma
 
Faster and Easier Software Development using Docker Platform
Faster and Easier Software Development using Docker PlatformFaster and Easier Software Development using Docker Platform
Faster and Easier Software Development using Docker Platformmsyukor
 
Talk about Docker
Talk about DockerTalk about Docker
Talk about DockerMeng-Ze Lee
 
Cloud Native Programing with Docker and Kubernetes
Cloud Native Programing with Docker and KubernetesCloud Native Programing with Docker and Kubernetes
Cloud Native Programing with Docker and KubernetesBallerina
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with DockerAndrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with DockerAndrey Hristov
 
Containerzation with Docker
Containerzation with DockerContainerzation with Docker
Containerzation with DockerAbdimuna Muna
 

Similar to Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension _ Docker.pdf (20)

Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdf
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
Docker @ Atlogys
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
 
Docker
DockerDocker
Docker
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
 
Axigen on docker
Axigen on dockerAxigen on docker
Axigen on docker
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
 
Overview of Docker
Overview of DockerOverview of Docker
Overview of Docker
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Shipping to Server and Cloud with Docker
Shipping to Server and Cloud with DockerShipping to Server and Cloud with Docker
Shipping to Server and Cloud with Docker
 
Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)
 
Faster and Easier Software Development using Docker Platform
Faster and Easier Software Development using Docker PlatformFaster and Easier Software Development using Docker Platform
Faster and Easier Software Development using Docker Platform
 
Talk about Docker
Talk about DockerTalk about Docker
Talk about Docker
 
Let's dockerize
Let's dockerizeLet's dockerize
Let's dockerize
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Cloud Native Programing with Docker and Kubernetes
Cloud Native Programing with Docker and KubernetesCloud Native Programing with Docker and Kubernetes
Cloud Native Programing with Docker and Kubernetes
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Containerzation with Docker
Containerzation with DockerContainerzation with Docker
Containerzation with Docker
 

Recently uploaded

Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 

Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension _ Docker.pdf

  • 1. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Hackathon time! Join us for the Docker AI/ML Hackathon now through November 7th. Sign up now ✕ Products Developers Pricing Blog About Us Partners Sign In Get Started
  • 2. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Ajeet Singh Raina Kamesh Sampath Continuous Integration (CI) is a key element of cloud native application development. With containers forming the Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension
  • 3. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker foundation of cloud-native architectures, developers need to integrate their version control system with a CI tool. There’s a myth that continuous integration needs a cloud-based infrastructure. Even though CI makes sense for production releases, developers need to build and test the pipeline before they can share it with their team — or have the ability to perform the continuous integration (CI) on their laptop. Is that really possible today? Introducing the Drone CI pipeline An open-source project called Drone CI makes that a reality. With over 25,700 GitHub stars and 300-plus contributors, Drone is a cloud-native, self-service CI platform. Drone CI offers a mature, container-based system that leverages the scaling and fault-tolerance characteristics of cloud-native architectures. It helps you build container-friendly pipelines that are simple, decoupled, and declarative. Drone is a container based pipeline engine that lets you run any existing containers as part of your pipeline or package your build logic into reusable containers called Drone Plugins. Drone plugins are configurable based on the need and that allows distributing the container within your organization or to the community in general. Running Drone CI pipelines from Docker Desktop For a developer working with decentralized tools, the task of building and deploying microservice applications can be monumental. It’s tricky to install, manage, and use these apps in those environments. That’s where Docker Extensions
  • 4. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker come in. With Docker Extensions, developer tools are integrated right into Docker Desktop — giving you streamlined management workflows. It’s easier to optimize and transform your development processes. The Drone CI extension for Docker Desktop brings CI to development machines. You can now import Drone CI pipelines into Docker Desktop and run them locally. You can also run specific steps of a pipeline, monitor execution results, and inspect logs. Setting up a Drone CI pipeline In this guide, you’ll learn how to set up a Drone CI pipeline from scratch on Docker Desktop. First, you’ll install the Drone CI Extension within Docker Desktop. Second, you’ll learn how to discover Drone pipelines. Third, you’ll see how to open a Drone pipeline on Visual Studio Code. Lastly, you’ll discover how to run CI pipelines in trusted mode, which grants them elevated privileges on the host machine. Let’s jump in. Prerequisites You’ll need to download Docker Desktop 4.8 or later before getting started. Make sure to choose the correct version for your OS and then install it. Next, hop into Docker Desktop and confirm that the Docker Extensions feature is enabled. Click the Settings gear > Extensions tab > check the “Enable Docker Extensions” box.
  • 5. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Installing the Drone CI Docker extension
  • 6. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Drone CI isn’t currently available on the Extensions Marketplace, so you’ll have to download it via the CLI. Launch your terminal and run the following command to install the Drone CI Extension: The Drone CI extension will soon appear in the Docker Dashboard’s left sidebar, underneath the Extensions heading: 1 docker extension install drone/drone-ci-docker-extension:latest
  • 7. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Import Drone pipelines You can click the “Import Pipelines” option to specify the host filesystem path where your Drone CI pipelines ( drone.yml files) are. If this is your first time with Drone CI pipelines, you can use the examples from our GitHub repo.
  • 8. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker In the recording above, we’ve used the long-run-demo sample to run a local pipeline that executes a long running sleep command. This occurs within a Docker container. 0:00 / 0:22
  • 9. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker You can download this pipeline YAML file from the Drone CI GitHub page. The file starts with a pipeline object that defines your CI pipeline. The type attribute defines your preferred runtime while executing that pipeline. Drone supports numerous runners like docker, kubernetes, and more. The extension only supports docker pipelines currently. Each pipeline step spins up a Docker container with the corresponding image defined as part of the step image attribute. Each step defines an attribute called commands . This is a list of shell commands that we want to execute as part of the build. The defined list of commands will be converted into shell script and set as Docker container’s ENTRYPOINT . If any command (for example, the missing yq command, in this case) returns a non-zero exit code, the pipeline fails and exits. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 kind: pipeline type: docker name: sleep-demos steps: - name: sleep5 image: busybox pull: if-not-exists commands: - x=0;while [ $x -lt 5 ]; do echo "hello"; sleep 1; x=$((x+1)); done - name: an error step image: busybox pull: if-not-exists commands: - yq --help
  • 10. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
  • 11. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker
  • 12. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Edit your pipeline faster in VS Code via Drone CI Visual Studio Code (VS Code) is a lightweight, highly-popular IDE. It supports JavaScript, TypeScript, and Node.js. VS Code also has a rich extensions ecosystem for numerous other languages and runtimes. Opening your Drone pipeline project in VS Code takes just seconds from within Docker Desktop:
  • 13. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker This feature helps you quickly view your pipeline and add, edit, or remove steps — then run them from Docker Desktop. It lets you iterate faster while testing new pipeline changes.
  • 14. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Running specific steps in the CI pipeline The Drone CI Extension lets you run individual steps within the CI pipeline at any time. To better understand this functionality, let’s inspect the following Drone YAML file: In this example, the first pipeline step defined as sleep5 lets you execute a shell script ( echo “hello” ) for five seconds and then stop (ignoring an error step ).The video below shows you how to run the specific sleep-demos stage within the pipeline: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 kind: pipeline type: docker name: sleep-demos steps: - name: sleep5 image: busybox pull: if-not-exists commands: - x=0;while [ $x -lt 5 ]; do echo "hello"; sleep 1; x=$((x+1)); done - name: an error step image: busybox pull: if-not-exists commands: - yq --help
  • 15. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker 0:00 / 0:09
  • 16. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Running steps in trusted mode Sometimes, you’re required to run a CI pipeline with elevated privileges. These privileges enable a user to systematically do more than a standard user. This is similar to how we pass the --privileged=true parameter within a docker run command. When you execute docker run --privileged , Docker will permit access to all host devices and set configurations in AppArmor or SELinux. These settings may grant the container nearly equal access to the host as processes running outside containers on the host. Drone’s trusted mode tells your container runtime to run the pipeline containers with elevated privileges on the host machine. Among other things, trusted mode can help you: Mount the Docker host socket onto the pipeline container Mount the host path to the Docker container
  • 17. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker 0:00 / 0:26
  • 18. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Run pipelines using environment variable files The Drone CI Extension lets you define environment variables for individual build steps. You can set these within a pipeline step. Like docker run provides a way to pass environment variables to running containers, Drone lets you pass usable environment variables to your build. Consider the following Drone YAML file: The file starts with a pipeline object that defines your CI pipeline. The type attribute defines your preferred runtime (Docker, in our case) while executing that pipeline. The platform section helps configure the target OS and architecture (like arm64 ) and routes the pipeline to the appropriate runner. If unspecified, the system defaults to Linux amd64 . The steps section defines a series of shell commands. These commands run within a busybox Docker container as the ENTRYPOINT . As shown, the command prints the environment variables if you’ve declared the following environment variables in your my-env file: 1 2 3 4 5 6 7 8 9 kind: pipeline type: docker name: default steps: - name: display environment variables image: busybox pull: if-not-exists commands: - printenv 1 2 DRONE_DESKTOP_FOO=foo DRONE_DESKTOP_BAR=bar
  • 19. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker You can choose your preferred environment file and run the CI pipeline (pictured below): If you try importing the CI pipeline, you can print every environment variable.
  • 20. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Run pipelines with secrets files We use repository secrets to store and manage sensitive information like passwords, tokens, and ssh keys. Storing this information as a secret is considered safer than storing it within a plain text configuration file. Note: Drone masks all values used from secrets while printing them to standard output and error. The Drone CI Extension lets you choose your preferred secrets file and use it within your CI pipeline as shown below:
  • 21. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Remove pipelines
  • 22. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker You can remove a CI pipeline in just one step. Select one or more Drone pipelines and remove them by clicking the red minus (“-”) button on the right side of the Dashboard. This action will only remove the pipelines from Docker Desktop — without deleting them from your filesystem. Bulk remove all pipelines
  • 23. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Remove a single pipeline Conclusion Drone is a modern, powerful, container-friendly CI that empowers busy development teams to automate their workflows. This dramatically shortens building, testing, and release cycles. With a Drone server, development teams can build and deploy cloud apps. These harness the scaling and fault-tolerance characteristics of cloud-native architectures like Kubernetes.
  • 24. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Check out Drone’s documentation to get started with CI on your machine. With the Drone CI extension, developers can now run their Drone CI pipelines locally as they would in their CI systems. Want to dive deeper into Docker Extensions? Check out our intro documentation, or discover how to build your own extensions.  Docker Desktop, Docker Extensions, Docker Hub Signing Docker Official Images Using OpenPubkey By Jonny Stoten October 13, 2023 Getting Started with JupyterLab as a Docker Extension By Marcelo Ochoa October 12, 2023 Security Advisory: High Severity Curl Vulnerability By Jonathan Roberts October 5, 2023
  • 25. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Posted Sep 20, 2022 Post Tags Docker Desktop Docker Extensions Docker Hub Categories Community Company Engineering Products       
  • 26. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker Products Docker Personal Docker Pro Docker Team Docker Business Docker Scout Desktop vs Docker Engine Docker Desktop Docker Hub Extensions Secure Software Supply Chain Container Runtime Developer Tools Trusted Content Docker Product Roadmap Support Developers Docs Getting Started Extensions SDK Community Open Source Preview Program System Status Pricing FAQ Docker Verified Publisher Partners Blog About Us What is a Container Why Docker Events Swag Store Newsroom Careers Contact Us Customers Trademark Guidelines
  • 27. 2023/10/20 上午9:18 Bring Continuous Integration to Your Laptop With the Drone CI Docker Extension | Docker © 2023 Docker Inc. All rights reserved | Terms of Service | Privacy | Legal Cookies Settings