Dockerfile
FROM node:lts
ARG UID=1001
ARG GID=1001
RUN echo "######### $UID"
RUN echo "######### $GID"
docker-compose.yml
version: '3.5'
services:
nest:
build:
context: ./dockerfiles/nest
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
docker-compose build --build-arg UID="1003" --build-arg GID="1003" --no-cache
By this, UID will be 1003 and GID will be 1003
-
.env
is not working -
export $UID
with shell script not working -
ARG UID=1005
not working -
compose-file
GID: ${GID:-1000}
is working -
build-arg
is working