Commit 9f1ed86b authored by opuk's avatar opuk

container

parent 6825243f
Pipeline #98483798 passed with stages
in 6 minutes and 29 seconds
......@@ -31,13 +31,46 @@ pipeline{
echo "GOPATH set to $GOPATH"
pushd $GOPATH/src/gitlab.com/opuk/eishin
go build -v
'''
'''
stash includes: 'go/bin/eishin', name: 'eishin'
}
}
stage('Stash artifact') {
stage('Build container') {
steps {
stash includes: 'go/bin/eishin', name: 'eishin'
unstash 'eishin'
sh '''
set -o errexit
podman system prune -y
# Create a container
container=$(buildah from registry.access.redhat.com/ubi8/ubi-minimal)
#fedora
buildah --net host run $container microdnf update -y
buildah run $container microdnf install shadow-utils
buildah run $container microdnf clean all
buildah run $container mkdir -p /eishin/conf
buildah run $container adduser eishin
buildah run $container chown -R eishin.eishin /eishin
buildah add $container go/bin/eishin /usr/local/bin
buildah run $container chmod 755 /usr/local/bin/eishin
buildah config --user eishin $container
buildah config --volume /eishin $container
buildah config --workingdir /eishin $container
buildah config --entrypoint /usr/local/bin/eishin $container
buildah commit $container quay.io/opuk/eishin
podman system df
'''
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment