使用Docker制作你的专属开发环境
今天教大家使用Docker制作一个自己专属的开发环境。
Dockerfile在项目的根目录下,新建Dockerfile文件,并写入下面的内容:
12345FROM alpine:latestADD package.json /root/package.jsonWORKDIR /tmpENV SHELL /bin/bashRUN apk add --no-cache nodejs=~18.14.2
上面一共5行代码,分别代表的含义如下。
FROM alpine:latest:该 image 文件继承官方的 alpine image,冒号表示标签,这里标签是latest,即latest版本的 node。
ADD package.json /root/package.json:将当前目录下的package.json文件复制到image文件的/root/目录。
WORKDIR /tmp:指定接下来的工作路径为/tmp。
ENV SHELL /bin/bash:添加环境变量SHELL=”/bin/bash”。
RUN apk add –no-cache nodejs=18.14.2:在/ ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment