This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 249
/
Copy pathinspect-docker-image.yml
56 lines (55 loc) · 1.89 KB
/
inspect-docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
resources:
- name: image-to-inspect
type: docker-image
source:
repository: pivotalcf/pivnet-resource # UPDATE THIS with the targeted image repo name
tag: "latest-final" # UPDATE THIS with the desired tag of the image
jobs:
- name: Inspect-Image
plan:
- get: image-to-inspect
params:
rootfs: true
- task: prepare-image-to-export
config:
platform: linux
inputs:
- name: image-to-inspect
outputs:
- name: export-directory
image_resource:
type: docker-image
source:
repository: pivotalservices/docker-concourse-cf-tools
run:
path: sh
args:
- -exc
- |
cd export-directory
cp ../image-to-inspect/metadata.json .
mkdir rootfs
tar -xvf ../image-to-inspect/rootfs.tar -C ./rootfs/ --exclude="dev/*"
cd rootfs
# add .keep file to all empty directories
find . -type d -empty -not -path "./.git/*" -exec touch {}/.keep \;
cd ../..
# WHAT TO DO FROM HERE
# Option 1)
# hijack into the container and then issue the
# sequence of commands below to seed rootfs repo
# with files prepared above from directory "export-directory":
# git clone <ROOT_FS_GIT_REPO_URL_GOES_HERE>
# cd <ROOT_FS_GIT_REPO_DIR>
# mv ../export-directory/metadata.json .
# mv ../export-directory/rootfs .
# git add .
# git config --global user.email "<YOUR_GIT_ACCOUNT_EMAIL_ADDRESS>"
# git config --global user.name "<YOUR_GIT_ACCOUNT_ID>"
# git commit -m "Add rootfs files"
# git push origin master
# Option 2)
# Create another task to this job that will consume the
# "export-directory" output and automatically push it to
# a repository (e.g. git)