拒绝Wsl2访问mkdir docker compose

trnvg8h3  于 2023-04-11  发布在  Docker
关注(0)|答案(1)|浏览(131)

在这样的DockerFile上

FROM node:8

ENV HOST localhost
ENV PORT 3000

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install GYP dependencies globally, will be used to code build other dependencies
RUN npm install -g --production node-gyp && \
    npm cache clean --force

# Install Gekko dependencies
COPY package.json .
RUN npm install --production && \
    npm install --production redis@0.10.0 talib@1.0.2 tulind@0.8.7 pg && \
    npm cache clean --force

# Install Gekko Broker dependencies
WORKDIR exchange
COPY exchange/package.json .
RUN npm install --production && \
    npm cache clean --force
WORKDIR ../

# Bundle app source
COPY . /usr/src/app

EXPOSE 3000
RUN chmod +x /usr/src/app/docker-entrypoint.sh
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]

CMD ["--config", "config.js", "--ui"]

我正在运行docker-compose up -d
在这样的docker-compose.yml上:

version: '3'
services:
  gekko:
    build: ./
    volumes:
      - ./volumes/gekko/history:/usr/src/app/history
      - ./config.js:/usr/src/app/config.js
    links:
      - redis
#      - postgresql
    environment:
     - HOST
     - PORT
     - USE_SSL
    ports: # you can comment this out when using the nginx frontend
      - "${PORT}:${PORT}"
## optionally set nginx vars if you wish to frontend it with nginx
#    environment:
#     - VIRTUAL_HOST=gekko
#     - PORT=3000
#     - DOMAIN=gekko

  redis:
    image: redis:latest
    volumes:
      - ./volumes/redis:/data
## optionally uncomment if you wish to use nginx as a frontend
#  nginx:
#    restart: always
#    image: jwilder/nginx-proxy
#    ports:
#     - "80:80"
#    volumes:
#     - /var/run/docker.sock:/tmp/docker.sock:ro
## optionally uncomment if you wish to use postgresql as a db
#  postgresql:
#    restart: always
#    image: postgres:9.6-alpine
#    ports:
#      - 5432:5432
#    volumes:
#      - ./_postgresql:/var/lib/postgresql/data:rw
#    environment:
#      POSTGRES_DB: gekko
#      POSTGRES_USER: username
#      POSTGRES_PASSWORD: password

不幸的是,我得到了这样的错误:

[+] Running 0/0
 - Container gekko-redis-1  Creating                                                                                                                                                                                                  0.0s 
Error response from daemon: mkdir C:\Users\userName\Desktop\Appsome_Repos\gekko\volumes: Access is denied.

我认为这可能是由一些WSL 2权限引起的,但我不知道在哪里更改它。
使用Windows和Docker:

我坚持了下来,任何帮助都是非常感激的。

ctehm74n

ctehm74n1#

解决方案是以管理员身份在Windows上运行Docker Desktop。

相关问题