'Permission Denied mapping Expo volumes in Docker
I am receiving a permission error when attempting to map volumes over. I don't understand because I should be root by default as far as I know. I tried chmodding the files 777 on my host but no effect.
client_1 |
client_1 | > web
client_1 | > expo start --web
client_1 |
client_1 | Uncaught Error Error: EACCES: permission denied, mkdir '/root/.expo'
arglasses_client_1 exited with code 1
# pull base image
FROM node:14
# set our node environment, either development or production
ARG NODE_ENV=development
ENV NODE_ENV $NODE_ENV
# default to port 19006 for node, and 19001 and 19002 (tests) for debug
ARG PORT=19006
ENV PORT $PORT
EXPOSE $PORT 19001 19002
# install global packages
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH /home/node/.npm-global/bin:$PATH
RUN npm i --unsafe-perm -g npm@latest expo-cli@latest
# install dependencies first, in a different location for easier app bind mounting for local development
RUN mkdir /opt/client
WORKDIR /opt/client
ENV PATH /opt/client/.bin:$PATH
# copy in our source code last, as it changes the most
WORKDIR /opt/client/app
# for development, we bind mount volumes; comment out for production
COPY . .
RUN npm install
ENTRYPOINT ["npm", "run"]
CMD ["web"]
services:
client:
build: client
environment:
- NODE_ENV=development
tty: true
ports:
- '19006:19006'
- '19001:19001'
- '19002:19002'
depends_on:
- server
volumes:
- ./client:/opt/client/app
- /opt/client/app/node_modules
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
