简体   繁体   English

如何知道哪个节点:高山映像版本在运行容器中

[英]How to know which node:alpine image version is in running container

I have one running container which uses node:alpine as base image.I want to know version of this image.我有一个正在运行的容器,它使用 node:alpine 作为基础镜像。我想知道这个镜像的版本。

Try running the command FROM node:<version>-alpine尝试运行命令 FROM node:<version>-alpine

You can also try running the command alpine -v or alpine -version .You can also start Alpine and press?您也可以尝试运行命令alpine -valpine -version 。您也可以启动 Alpine 并按? on the main menu to open the main Help page, which will also tell you the version.在主菜单上打开主帮助页面,该页面也会告诉您版本。

Refer to the link for more information.有关更多信息,请参阅链接

You can check the Dockerfile of the container if handy.如果方便,您可以查看容器的Dockerfile

You can check the first line with FROM node:<version>-alpine您可以使用FROM node:<version>-alpine检查第一行

For example:例如:

FROM node:12.18.1-alpine
ENV NODE_ENV=production
WORKDIR /app

You can also use the command docker image inspect您还可以使用命令docker image inspect

https://docs.docker.com/engine/reference/commandline/image_inspect/ https://docs.docker.com/engine/reference/commandline/image_inspect/

You can also exec into the container to check the version of Node您还可以执行到容器中以检查Node的版本

Command to check node version:检查节点版本的命令:

docker exec -ti <Container name> sh -c "node --version"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM