Home > Mobile >  Understanding comand in run of docker
Understanding comand in run of docker

Time:12-29

I have code which have dockerfile having this

FROM node:16-slim AS base
RUN apt-get update
RUN apt-get -y install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

RUN useradd -ms /bin/bash xyz-deployer
WORKDIR /srv/app
RUN chmod -R g rwX /srv/app
RUN yarn global add ts-node@^10.1.0

Can someone please tell me what is this doing in particular?

RUN useradd -ms /bin/bash xyz-deployer
WORKDIR /srv/app
RUN chmod -R g rwX /srv/app

CodePudding user response:

RUN useradd -ms /bin/bash xyz-deployer

creates a new user called xyz-deployer with a home directory and /bin/bash as the shell.

WORKDIR /srv/app

changes the working directory to /srv/app.

RUN chmod -R g rwX /srv/app

sets all files in /srv/app to be group readable, writable and executable.

It doesn't make much sense in the context of the Dockerfile you've shown, but hopefully it helps.

  • Related