Exp 10 Sepm
Exp 10 Sepm
wsl --install
wsl --set-default-version 2
docker version
cd C:\Users\Admin\myfirst
mkdir DockerJenkinsExperiment
cd DockerJenkinsExperiment
mkdir webapp
cd webapp
notepad index.html
<!DOCTYPE html>
<html>
<head>
<title>Docker Jenkins Experiment</title>
</head>
<body>
<h1>Hello from Docker!</h1>
</body>
</html>
cd ..
notepad Dockerfile
FROM nginx:latest
COPY webapp /usr/share/nginx/html
EXPOSE 80
This will:
notepad Jenkinsfile
pipeline {
agent any
stages {
stage('Checkout Code') {
steps {
steps {
}
}
steps {
git add .
git commit -m "Added Docker experiment files"
http://localhost:8081
Note* to delete old container run the following commands in powershell (admin mode)
docker rm <container_id>