简体   繁体   中英

Running azcopy inside docker container throws spawn EACCES error

I've created the following docker file:

FROM node:12.14.0-alpine
RUN apk upgrade --update-cache --available && \
    apk add openssl && \
    apk add --no-cache --virtual python libc6-compat make g++ pkgconf libsecret-dev && \
    rm -rf /var/cache/apk/*

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
WORKDIR /app

COPY . .

RUN npm install --registry https://registry.npmjs.org @azure-tools/azcopy-node

EXPOSE 8080
CMD ["npm", "run", "start"]

When running an azcopy command inside the container i'm getting the following error:

spawn /app/node_modules/@azure-tools/azcopy-linux/dist/bin/azcopy_linux_amd64 EACCES

How can I fix it?

I had to add permissions to the azprocess in the docker file, now it works:

FROM node:12.14.0-alpine
RUN apk upgrade --update-cache --available && \
    apk add openssl && \
    apk add --no-cache --virtual python libc6-compat make g++ pkgconf libsecret-dev && \
    rm -rf /var/cache/apk/*

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
WORKDIR /app

COPY . .

RUN npm install --registry https://registry.npmjs.org @azure-tools/azcopy-node
RUN chmod a+x /app/node_modules/@azure-tools/azcopy-linux/dist/bin/azcopy_linux_amd64

EXPOSE 8080
CMD ["npm", "run", "start"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM