mirror of https://github.com/docker/docs.git
Merge pull request #10508 from justincormack/2not3
Use original short forms of Docker commands
This commit is contained in:
commit
e69e17c55a
|
@ -146,7 +146,7 @@ Docker version 19.03.5, build 633a0ea
|
|||
3. List the `hello-world` container (spawned by the image) which exits after displaying its message. If it is still running, you do not need the `--all` option:
|
||||
|
||||
```shell
|
||||
$ docker container ls --all
|
||||
$ docker ps --all
|
||||
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS
|
||||
54f4984ed6a8 hello-world "/hello" 20 seconds ago Exited (0) 19 seconds ago
|
||||
|
|
|
@ -141,7 +141,7 @@ Now that you have some source code and a Dockerfile, it's time to build your fir
|
|||
Make sure you're in the directory `node-bulletin-board/bulletin-board-app` in a terminal or PowerShell using the `cd` command. Let's build your bulletin board image:
|
||||
|
||||
```script
|
||||
docker image build -t bulletinboard:1.0 .
|
||||
docker build --tag bulletinboard:1.0 .
|
||||
```
|
||||
|
||||
You'll see Docker step through each instruction in your Dockerfile, building up your image as it goes. If successful, the build process should end with a message `Successfully tagged bulletinboard:1.0`.
|
||||
|
@ -153,7 +153,7 @@ You'll see Docker step through each instruction in your Dockerfile, building up
|
|||
1. Start a container based on your new image:
|
||||
|
||||
```script
|
||||
docker container run --publish 8000:8080 --detach --name bb bulletinboard:1.0
|
||||
docker run --publish 8000:8080 --detach --name bb bulletinboard:1.0
|
||||
```
|
||||
|
||||
There are a couple of common flags here:
|
||||
|
@ -169,10 +169,10 @@ You'll see Docker step through each instruction in your Dockerfile, building up
|
|||
3. Once you're satisfied that your bulletin board container works correctly, you can delete it:
|
||||
|
||||
```script
|
||||
docker container rm --force bb
|
||||
docker rm --force bb
|
||||
```
|
||||
|
||||
The `--force` option removes the running container.
|
||||
The `--force` option removes the running container. If you stop the container running with `docker stop bb` you do not need to use `--force`.
|
||||
|
||||
## Conclusion
|
||||
|
||||
|
|
|
@ -45,13 +45,13 @@ At this point, you've set up your Docker Hub account and have connected it to yo
|
|||
3. Now you are ready to share your image on Docker Hub, but there's one thing you must do first: images must be *namespaced correctly* to share on Docker Hub. Specifically, you must name images like `<Docker ID>/<Repository Name>:<tag>`. You can relabel your `bulletinboard:1.0` image like this (of course, please replace `gordon` with your Docker ID):
|
||||
|
||||
```shell
|
||||
docker image tag bulletinboard:1.0 gordon/bulletinboard:1.0
|
||||
docker tag bulletinboard:1.0 gordon/bulletinboard:1.0
|
||||
```
|
||||
|
||||
4. Finally, push your image to Docker Hub:
|
||||
|
||||
```shell
|
||||
docker image push gordon/bulletinboard:1.0
|
||||
docker push gordon/bulletinboard:1.0
|
||||
```
|
||||
|
||||
Visit your repository in Docker Hub, and you'll see your new image there. Remember, Docker Hub repositories are public by default.
|
||||
|
|
Loading…
Reference in New Issue