Build Development Enviroment Through DockerFile
Step into the path where dockerfile locates, and just run the following command.
docker build -t {IMAGE_NAME}:{IMAGE_VERSION} .
Use docker images
to check out if you have builded your image correctly.
then input the following command to build a container based on your image.
docker run -itv {LOCAL_FILEFOLDER}:{CONTAINER_FILEFOLDER} -p {FREE_PORT}:22 (-d) {IMAGE_NAME}:{IMAGE_VERSION} /bin/bash
- Open Dockerfile in vscode.Click right mouse and choose Build Image...
- Fill settings in devcontainer.json and reopen in container.
Touch docker-compose.yml and input your settings, then run the following command
docker-compose up (-d)