Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker image build vs docker build

Tags:

Why does my Docker client recognize docker build but not docker image build? Is the client too old? Does CLI depends on client or server? I believe I got my Docker client and server by installing the latest Docker toolbox.

$ docker version Client: Version:      1.12.5 API version:  1.24 Go version:   go1.6.4 Git commit:   7392c3b Built:        Fri Dec 16 06:14:34 2016 OS/Arch:      windows/amd64  Server: Version:      18.01.0-ce API version:  1.35 Go version:   go1.9.2 Git commit:   03596f5 Built:        Wed Jan 10 20:13:12 2018 OS/Arch:      linux/amd64  $ docker image build docker: 'image' is not a docker command. See 'docker --help'.  $ docker build "docker build" requires exactly 1 argument(s). See 'docker build --help'.  Usage:  docker build [OPTIONS] PATH | URL | -  Build an image from a Dockerfile 
like image 474
thinkbot Avatar asked Feb 07 '18 15:02

thinkbot


People also ask

What is the difference between Docker image build and Docker build?

They are exactly the same. docker build was the original command, but later on all the image manipulation commands were moved under the docker image subcommand. The originals were preserved for compatability.

What is Docker image build?

Description. The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in the specified PATH or URL . The build process can refer to any of the files in the context. For example, your build can use a COPY instruction to reference a file in the context ...

What is difference between Docker and Docker image?

The key difference between a Docker image vs a container is that a Docker image is a template that defines how a container will be realized. A Docker container is a runtime instance of a Docker image. The purpose of this piece is to answer the question, what is a Docker image vs.

Is Docker container same as image?

A Docker image executes code in a Docker container. You add a writable layer of core functionalities on a Docker image to create a running container. Think of a Docker container as a running image instance. You can create many containers from the same image, each with its own unique data and state.


1 Answers

The client version is old. The new commad structure is supported with client 1.13. Check Docker CLI restructured.

There was a refactoring for the command line client to have the form:

docker <management command> <command> 

The new command structure still supports the old way. For instance, the old docker ps is an alias for docker container ls and the old docker build is alias to docker image build.

like image 95
yamenk Avatar answered Sep 29 '22 12:09

yamenk