Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build docker image from dockerfile #311

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build-with-dockerfile/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM node:16-alpine

RUN apk add -U git curl
14 changes: 14 additions & 0 deletions build-with-dockerfile/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pipeline {
agent { dockerfile true }
stages {
stage('Test') {
steps {
sh '''
node --version
git --version
curl --version
'''
}
}
}
}
3 changes: 3 additions & 0 deletions build-with-dockerfile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# BUILD IMAGE FROM DOCKERFILE

For projects requiring a more customized execution environment, Pipeline also supports building and running a container from a Dockerfile in the source repository. In contrast to the previous approach of using an "off-the-shelf" container, using the agent { dockerfile true } syntax builds a new image from a Dockerfile, rather than pulling one from Docker Hub.