mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
Added Docker CLI binary to final image
This commit is contained in:
parent
dec14665e1
commit
98697c544e
2 changed files with 20 additions and 1 deletions
17
Dockerfile
17
Dockerfile
|
|
@ -14,6 +14,20 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} GOARM=${GOARM} go build -a -ldflag
|
||||||
-X main.version=${VERSION} \
|
-X main.version=${VERSION} \
|
||||||
-X main.buildSource=Docker"
|
-X main.buildSource=Docker"
|
||||||
|
|
||||||
|
FROM ${BASE_IMAGE_BUILDER}:${GO_VERSION}-alpine${ALPINE_VERSION} AS docker-builder
|
||||||
|
ARG GOARCH=amd64
|
||||||
|
ARG GOARM
|
||||||
|
ARG DOCKER_VERSION=v18.09.7
|
||||||
|
RUN apk add -U -q --progress --no-cache git bash coreutils gcc musl-dev
|
||||||
|
WORKDIR /go/src/github.com/docker/cli
|
||||||
|
RUN git clone --branch ${DOCKER_VERSION} --single-branch --depth 1 https://github.com/docker/cli.git . > /dev/null 2>&1
|
||||||
|
ENV CGO_ENABLED=0 \
|
||||||
|
GOARCH=${GOARCH} \
|
||||||
|
GOARM=${GOARM} \
|
||||||
|
DISABLE_WARN_OUTSIDE_CONTAINER=1
|
||||||
|
RUN ./scripts/build/binary
|
||||||
|
RUN rm build/docker && mv build/docker-linux-* build/docker
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
ARG VCS_REF
|
ARG VCS_REF
|
||||||
|
|
@ -28,4 +42,5 @@ LABEL org.label-schema.schema-version="1.0.0-rc1" \
|
||||||
org.label-schema.version=${VERSION}
|
org.label-schema.version=${VERSION}
|
||||||
ENTRYPOINT [ "/lazydocker" ]
|
ENTRYPOINT [ "/lazydocker" ]
|
||||||
VOLUME [ "/.config/jesseduffield/lazydocker" ]
|
VOLUME [ "/.config/jesseduffield/lazydocker" ]
|
||||||
COPY --from=builder /go/src/github.com/jesseduffield/lazydocker/lazydocker /lazydocker
|
ENV PATH=/
|
||||||
|
COPY --from=docker-builder /go/src/github.com/docker/cli/build/docker /docker
|
||||||
|
|
@ -117,6 +117,10 @@ docker build -t lazyteam/lazydocker \
|
||||||
.
|
.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you encounter a compatibility issue with Docker bundled binary, try rebuilding
|
||||||
|
the image with the build argument `--build-arg DOCKER_VERSION="v$(docker -v | cut -d" " -f3 | rev | cut -c 2- | rev)"`
|
||||||
|
so that the bundled docker binary matches your host docker binary version.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Call `lazydocker` in your terminal. I personally use this a lot so I've made an alias for it like so:
|
Call `lazydocker` in your terminal. I personally use this a lot so I've made an alias for it like so:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue