added build script for container (buildah)
parent
a43cae385c
commit
73afbef415
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Remember to run buildah unshare before launching this
|
||||||
|
# Build container
|
||||||
|
echo "Start creating first stage "
|
||||||
|
buildctrl=$(buildah from golang:1.15.2)
|
||||||
|
buildmnt=$(buildah mount $buildctrl)
|
||||||
|
|
||||||
|
buildah copy $buildctrl *.go .
|
||||||
|
buildah copy $buildctrl Makefile .
|
||||||
|
buildah run $buildctrl make deps
|
||||||
|
buildah run $buildctrl make
|
||||||
|
|
||||||
|
# Runtime container
|
||||||
|
echo "Start creating second stage"
|
||||||
|
buildctrl2=$(buildah from alpine:latest)
|
||||||
|
buildmnt2=$(buildah mount $builctrl2)
|
||||||
|
|
||||||
|
buildah copy $buildctrl2 $buildmnt/go/metrorama
|
||||||
|
buildah config --cmd ./metrorama $buildctrl2
|
||||||
|
buildah config --port 8080 $buildctrl2
|
||||||
|
buildah unmount $buildctrl
|
||||||
|
buildah unmount $buildctrl2
|
||||||
|
buildah commit $buildctrl2 metrorama:latest
|
||||||
|
buildah rm $buildctrl $buildctrl2
|
Loading…
Reference in New Issue