xxxxxxxxxx
FROM golang:1.7.3 AS builder
WORKDIR /go/src/github.com/alexellis/href-counter/
RUN go get -d -v golang.org/x/net/html
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/github.com/alexellis/href-counter/app .
CMD ["./app"]
xxxxxxxxxx
#You will need to save the Docker image as a tar file:
docker save -o <path for generated tar file> <image name>
#Then copy your image to a new system with regular file transfer tools such as cp, scp or rsync(preferred for big files). After that you will have to load the image into Docker:
docker load -i <path to image tar file>
#PS: You may need to sudo all commands.
#Example
# In Source Machine
docker save -o c:/myfile.tar centos:16
# In Destination Machine
docker load -i c:/myfile.tar
xxxxxxxxxx
id=$(docker create image-name)
docker cp $id:path - > local-tar-file
docker rm -v $id
xxxxxxxxxx
docker save -o <path for generated tar file> <image name>
docker load -i <path to image tar file>