Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

groupadd: GID '0' already exists #4

Open
lucasconstantino opened this issue Apr 25, 2018 · 5 comments
Open

groupadd: GID '0' already exists #4

lucasconstantino opened this issue Apr 25, 2018 · 5 comments
Labels
bug Something isn't working troubleshooting

Comments

@lucasconstantino
Copy link

While building the project, some users are reporting the following issue:

groupadd: GID '0' already exists

Apparently, the environment variable GROUP_ID is not coming as expected.

@lucasconstantino lucasconstantino added bug Something isn't working troubleshooting labels Apr 25, 2018
@lucasconstantino
Copy link
Author

@renatorib has fixed the issue by basically removing any user/group creation. The resulting Dockerfile is as follows:

FROM taller/drupal-node
# Build-time configuration.
# -------------------------
# This is mostly useful to override on CIs.
ARG APP_NAME=drupal
ARG GROUP_ID=1000
ARG USER_ID=1000
# Configure environment.
# ----------------------
ENV APP_NAME=${APP_NAME}
ENV USER_NAME=${APP_NAME}
# ENV GROUP_ID=${GROUP_ID}
# ENV GROUP_NAME=${APP_NAME} USER_ID=${USER_ID} USER_NAME=${APP_NAME}
# Create group and user.
# ----------------------
# RUN groupadd --gid ${GROUP_ID} ${GROUP_NAME}                                                                          \
#    && echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers                                                           \
#    && useradd -u ${USER_ID} -G users,www-data,sudo -g ${GROUP_NAME} -d /${APP_NAME} --shell /bin/bash -m ${APP_NAME} \
#    && echo "secret\nsecret" | passwd ${USER_NAME}
# Nginx configs.
# -------------
COPY ./nginx.conf /etc/nginx/nginx.conf
# Import files.
# -------------
COPY ./.bashrc /${APP_NAME}/.bashrc
# RUN chown ${USER_NAME}:${GROUP_NAME} /${APP_NAME}/.bashrc
# Make site available.
# --------------------
RUN rm -Rf /var/www/drupal \
    && ln -s /${USER_NAME}/app/drupal /var/www/drupal
# Install node global dependencies.
# ---------------------------------
COPY ./.nvmrc /etc/.nvmrc
RUN . /usr/local/nvm/nvm.sh && \
    cd /etc/ && nvm install v8.9.1 && nvm alias default && nvm use default && \
    npm install -g yarn
# Setup user and initialization directory.
# ----------------------------------------
# USER ${USER_NAME}
WORKDIR /${USER_NAME}/app
# Setup PATH env variables.
# -------------------------
ENV PATH="/${USER_NAME}/app/vendor/bin:$PATH"
# Install prestissimo for faster composer installs.
# -------------------------------------------------
# RUN sudo cp -R /root/.composer /${USER_NAME}/.composer \
#    && sudo chown ${USER_NAME}:${GROUP_NAME} -R /${USER_NAME}/.composer
# Setup default App variables.
# ----------------------------
ENV GRAPHQL_HOST="http://localhost/graphql"
# Configure entrypoint.
# ---------------------
COPY ./entrypoint.sh /etc/entrypoint.sh
RUN sudo chmod +x /etc/entrypoint.sh
CMD ["/bin/bash"]
ENTRYPOINT ["/etc/entrypoint.sh"]

@sebas5384 could you have a look at that?

@renatorib
Copy link

renatorib commented Apr 26, 2018

I guess it might be related to sudo

@lucasconstantino
Copy link
Author

@renatorib it might be. But honestly, if we can simply get rid of this it would make the building simpler. We simply need to understand what issues does it solve. As far as I remember, this was only needed for Mac users - but is it really so?

@renatorib
Copy link

Yea, I totally agree. And yes, I think that was the only problem I had.

@francisrod01
Copy link

I also had this error.
I'm not Mac user. I'm using Debian Linux.

During the installation process, in the file docker-compose.yml..

app:
    extends: meta
    image: taller-chat-app
    build:
      context: ./docker/
      args:
        USER_ID: "$USER_ID"
        GROUP_ID: "$GROUP_ID"
...

I remove args property of taller-chat-app and run make run again,
It works totally fine!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working troubleshooting
Projects
None yet
Development

No branches or pull requests

3 participants