Answers for "copy file from docker image"


docker copy from another image

FROM golang:1.7.3 AS builder
WORKDIR /go/src/
RUN go get -d -v  
COPY app.go    .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .

FROM alpine:latest  
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/ .
CMD ["./app"]
Posted by: Guest on September-02-2020

copy file from docker image

id=$(docker create image-name)
docker cp $id:path - > local-tar-file
docker rm -v $id
Posted by: Guest on October-18-2021

Code answers related to "copy file from docker image"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language