How to create custom image in docker using VSCode?

Viewed 208

I am new to docker, and I'm creating new custom alpine docker image using VSCode. Below is the set of commands I have mentioned on my file(Dockerfile):

# Step1 specify the base image
FROM alpine

# Download and install dependencies
RUN apk add --update redis

# Setup the startup command
CMD ["redis-server"]

Now, when I am running the docker build command in vs terminal, I am getting an error,

PS C:\Users\ankurpandey\Desktop\StudyMaterial\dockerfile-custom> docker build .

[+] Building 0.1s (2/2) FINISHED

 => [internal] load .dockerignore 0.1s
 => transferring context: 2B 0.0s  
 => [internal] load build definition from Dockerfile 0.0s  
 => transferring dockerfile: 2B 0.0s 

failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount460459348/Dockerfile: no such file or directory    

I have created only one plain file in my root folder dockerfile-custom i.e., Dockerfile as shown in the image

Please suggest me what going wrong with the steps? Thanks!!

1 Answers
Related