-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Implement Docker image #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
RUN groupadd -g 1000 app \ | ||
&& useradd -d /app -s /bin/bash -g app app \ | ||
&& chown -R app:app /app | ||
|
||
RUN git clone https://github.com/awilliam/rom-parser && \ | ||
cd rom-parser && \ | ||
make && \ | ||
chmod +x rom-parser && \ | ||
mv rom-parser /usr/local/bin | ||
|
||
WORKDIR /app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chown of /app before creation causes an error 0.102 chown: cannot access '/app': No such file or directory
RUN groupadd -g 1000 app \ | |
&& useradd -d /app -s /bin/bash -g app app \ | |
&& chown -R app:app /app | |
RUN git clone https://github.com/awilliam/rom-parser && \ | |
cd rom-parser && \ | |
make && \ | |
chmod +x rom-parser && \ | |
mv rom-parser /usr/local/bin | |
WORKDIR /app | |
WORKDIR /app | |
RUN groupadd -g 1000 app \ | |
&& useradd -d /app -s /bin/bash -g app app \ | |
&& chown -R app:app /app | |
RUN git clone https://github.com/awilliam/rom-parser && \ | |
cd rom-parser && \ | |
make && \ | |
chmod +x rom-parser && \ | |
mv rom-parser /usr/local/bin |
|
||
ENV PATH=$PATH:$HOME/.gem/bin | ||
|
||
RUN curl -LO https://github.com/LongSoft/UEFITool/releases/download/A68/UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && unzip UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && mv uefiextract ./3rdparty/UEFIExtract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL doesn't update with argument properly
RUN curl -LO https://github.com/LongSoft/UEFITool/releases/download/A68/UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && unzip UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && mv uefiextract ./3rdparty/UEFIExtract | |
RUN curl -LO https://github.com/LongSoft/UEFITool/releases/download/${UEFIExtract_VERSION}/UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && unzip UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && mv uefiextract ./3rdparty/UEFIExtract |
bundle config set --local path '/app/.gem' && \ | ||
bundle install --path=vendor/bundle | ||
|
||
ENV PATH=$PATH:$HOME/.gem/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Home doesn't work well, absolute path is better
ENV PATH=$PATH:$HOME/.gem/bin | |
ENV PATH="/app/.gem/bin:$PATH" |
USER app | ||
|
||
COPY --chown=app:app . . | ||
|
||
# https://github.com/coderobe/VBiosFinder/issues/50 | ||
# https://github.com/coderobe/VBiosFinder/pull/51 | ||
RUN git remote add vkhodygo https://github.com/vkhodygo/VBiosFinder.git && \ | ||
git fetch vkhodygo && \ | ||
git rebase | ||
|
||
RUN mkdir -p /app/.gem && \ | ||
bundle config set --local path '/app/.gem' && \ | ||
bundle install --path=vendor/bundle | ||
|
||
ENV PATH=$PATH:$HOME/.gem/bin | ||
|
||
RUN curl -LO https://github.com/LongSoft/UEFITool/releases/download/A68/UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && unzip UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && mv uefiextract ./3rdparty/UEFIExtract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is much better to layer modules and less frequently changing things first:
USER app
RUN mkdir ./output && mkdir ./3rdparty
RUN curl -LO https://github.com/LongSoft/UEFITool/releases/download/${UEFIExtract_VERSION}/UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && unzip UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && mv uefiextract ./3rdparty/UEFIExtract
COPY --chown=app:app Gemfile* ./
# Install the Ruby gems
RUN mkdir -p /app/.gem && \
bundle config set --local path '/app/.gem' && \
bundle install --path=vendor/bundle
COPY --chown=app:app . .
ENV PATH="/app/.gem/bin:$PATH"
The goal is to make the code easy for others to understand without the need to search for dependencies.
Although the repository is older, it can still be valuable for resourceful individuals who come across it.
50
51