Skip to content

Commit

Permalink
installing docker cli
Browse files Browse the repository at this point in the history
  • Loading branch information
wjayesh committed Aug 7, 2020
1 parent 4a392a6 commit dbecbc1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /app
# Copy go mod and sum files
COPY go.mod go.sum ./

# Download all dependancies. Dependencies will be cached if the go.mod and go.sum files are not changed
# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod download

# Copy the source from the current directory to the Working Directory inside the container
Expand All @@ -24,6 +24,16 @@ WORKDIR /app/cmd/dnsq/
# Build the q source into executable
RUN GOOS=linux go build -o q .

# Installing curl
RUN apt-get update
RUN apt-get install -y curl

# Installing Docker CLI (not the whole installation)
ENV DOCKER_VERSION=18.09.4
RUN curl -sfL -o docker.tgz "https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz" && \
tar -xzf docker.tgz docker/docker --strip=1 --directory /app/cmd/docker/ && \
rm docker.tgz


######## Start a new stage from scratch #######
FROM ubuntu:latest
Expand All @@ -36,6 +46,9 @@ COPY --from=builder /app/cmd/coredns-healthcheck/ .
# Copy the pre-built q binary from previous stage
COPY --from=builder /app/cmd/dnsq/ .

# Copy the docker cli to the bin
COPY --from=builder /app/cmd/docker/ /usr/local/bin

# Execute main when starting container
ENTRYPOINT ["./main"]

Expand Down

0 comments on commit dbecbc1

Please sign in to comment.