What is .build-deps for apk add –virtual command?

What is .build-deps in the following command? I can’t find an explanation in the Alpine docs. Is this a file that is predefined? Is see this referenced in many Dockerfiles. RUN apk add –no-cache –virtual .build-deps \ gcc \ freetype-dev \ musl-dev RUN pip install –no-cache-dir <packages_that_require_gcc…> \ RUN apk del .build-deps 2 Answers 2

How can I use a variable inside a Dockerfile CMD?

Inside my Dockerfile: ENV PROJECTNAME mytestwebsite CMD [“django-admin”, “startproject”, “$PROJECTNAME”] Error: CommandError: ‘$PROJECTNAME’ is not a valid project name What is the quickest workaround here? Does Docker have any plan to “fix” or introduce this functionality in later versions of Docker? NOTE: If I remove the CMD line from the Docker file and then run … Read more

Why is Docker installed but not Docker Compose?

I have installed docker on CentOS 7 by running following commands, curl -sSL https://get.docker.com/ | sh systemctl enable docker && systemctl start docker docker run hello-world NOTE: helloworld runs correctly and no issues. however when I try to run docker-compose (docker-compose.yml exists and valid) it gives me the error on CentOS only (Windows version works … Read more

What is the point of WORKDIR on Dockerfile?

I’m learning Docker. For many times I’ve seen that Dockerfile has WORKDIR command: FROM node:latest RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app EXPOSE 3000 CMD [ “npm”, “start” ] Can’t I just omit WORKDIR and Copy and just have my Dockerfile at the root of my project? … Read more