Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

279
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!