hopefully
parent
94737c4807
commit
94b257ad4d
7
do.sh
7
do.sh
|
|
@ -4,6 +4,7 @@ function main() {
|
|||
set -e
|
||||
set -u
|
||||
thispkg="${PWD##*$GOPATH/}"
|
||||
thisexec="$(basename "$thispkg")"
|
||||
function cleanup() {
|
||||
rm "$compile"
|
||||
rm "$dockfile"
|
||||
|
|
@ -148,7 +149,7 @@ set -u
|
|||
|
||||
go get -d ./...
|
||||
|
||||
CGO_ENABLED=0 go build -o /go/bin/exec -a -installsuffix cgo
|
||||
CGO_ENABLED=0 go build -o /go/bin/'"$thisexec"' -a -installsuffix cgo
|
||||
' > "$compile"
|
||||
|
||||
from="golang:1.10-alpine"
|
||||
|
|
@ -172,15 +173,15 @@ RUN apk update && apk add ca-certificates
|
|||
#========================
|
||||
|
||||
FROM busybox:glibc
|
||||
COPY --from=builder /go/bin /main
|
||||
COPY --from=builder /go/'"$thispkg"' /main
|
||||
COPY --from=builder /go/bin /main
|
||||
RUN mkdir -p /var/log
|
||||
WORKDIR /main
|
||||
ENV GOPATH=""
|
||||
ENV MNT="/mnt/"
|
||||
#COPY /etc/ssl/certs /etc/ssl
|
||||
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
|
||||
ENTRYPOINT ["/main/exec"]
|
||||
ENTRYPOINT ["/main/'"$thisexec"'"]
|
||||
'
|
||||
echo "$DOCKERFILE" > "$dockfile"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue