Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

280
Visualizações
Download a git repository in Dockerfile

I use docker.com to build automatically whenever I puch a commit to my GitHub repository. (see https://docs.docker.com/docker-hub/builds/)

I would like to call luacheck on all files in the docker image and let it fail if there are warnings.

I added a Lua error on purpose and added these lines in my Dockerfile:

RUN useradd -d /gluon gluon
RUN cd /gluon
RUN git clone https://github.com/rubo77/gluon/ gluon
RUN cd gluon

USER gluon

VOLUME /gluon
WORKDIR /gluon

RUN git checkout docker 
RUN cp -a docs/site-example/ site
RUN luacheckrc .; if [ $? -gt 0 ]; then exit 1; fi

see: https://github.com/rubo77/gluon/commits/docker

But it fails

/bin/sh: 1: cd: can't cd to /gluon

even before the git repository

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You have to create the directory for the gluon user first and give it write-rights with:

FROM ubuntu
RUN useradd -d /gluon gluon
RUN apt-get update && apt-get install -y git
RUN mkdir /gluon
RUN chown -R gluon:gluon /gluon
USER gluon
RUN cd /gluon
RUN git clone https://github.com/rubo77/gluon/ gluon
RUN cd gluon

VOLUME /gluon
WORKDIR /gluon
RUN git checkout docker
RUN cp -a docs/site-example/ site
RUN luacheck .; if [ $? -gt 0 ]; then exit 1; fi
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda