mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: separate base image of quest
* change to use Ubuntu as base image
This commit is contained in:
1 parent
99da610d9e
commit
5ec9ae52ce
4 files changed
+50
-33
No files matched your search
@@ -54,6 +54,12 @@ services:
|
||||
context: .
|
||||
dockerfile: quests/helloworld/Dockerfile
|
||||
|
||||
base:
|
||||
image: lancatlin/linux-odyssey:base
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./quests/Dockerfile
|
||||
|
||||
networks:
|
||||
internal:
|
||||
players:
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
FROM ubuntu:22.04
|
||||
|
||||
LABEL maintainer="wancat@wancat.cc"
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
locales \
|
||||
curl \
|
||||
vim \
|
||||
zsh \
|
||||
ca-certificates \
|
||||
gnupg
|
||||
|
||||
RUN sed -i -e 's/# zh_TW.UTF-8 UTF-8/zh_TW.UTF-8 UTF-8/' /etc/locale.gen && \
|
||||
dpkg-reconfigure --frontend=noninteractive locales && \
|
||||
update-locale LANG=zh_TW.UTF-8
|
||||
|
||||
ENV LANG zh_TW.UTF-8
|
||||
ENV LANGUAGE zh_TW:zh
|
||||
ENV LC_ALL zh_TW.UTF-8
|
||||
|
||||
ENV NODE_MAJOR=20
|
||||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
||||
RUN apt-get update && apt-get install nodejs -y
|
||||
|
||||
WORKDIR /usr/local/lib/container
|
||||
|
||||
RUN npm install -g yarn
|
||||
COPY ./packages/container/package.json ./yarn.lock ./
|
||||
RUN yarn install --modules-folder /usr/src/node_modules
|
||||
ENV NODE_PATH=/usr/src/node_modules
|
||||
COPY ./packages/container /usr/local/lib/container
|
||||
|
||||
ENV USERNAME=commander
|
||||
|
||||
RUN adduser --disabled-password --gecos '' --shell /bin/zsh ${USERNAME}
|
||||
|
||||
USER ${USERNAME}
|
||||
|
||||
WORKDIR /home/${USERNAME}
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
FROM node:latest
|
||||
FROM lancatlin/linux-odyssey:base
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
locales \
|
||||
curl \
|
||||
vim \
|
||||
zsh
|
||||
|
||||
RUN sed -i -e 's/# zh_TW.UTF-8 UTF-8/zh_TW.UTF-8 UTF-8/' /etc/locale.gen && \
|
||||
dpkg-reconfigure --frontend=noninteractive locales && \
|
||||
update-locale LANG=zh_TW.UTF-8
|
||||
|
||||
ENV LANG zh_TW.UTF-8
|
||||
ENV LANGUAGE zh_TW:zh
|
||||
ENV LC_ALL zh_TW.UTF-8
|
||||
|
||||
WORKDIR /usr/local/lib/container
|
||||
|
||||
COPY ./packages/container/package.json ./yarn.lock ./
|
||||
|
||||
RUN yarn install --modules-folder /usr/src/node_modules
|
||||
|
||||
ENV NODE_PATH=/usr/src/node_modules
|
||||
|
||||
COPY ./packages/container /usr/local/lib/container
|
||||
|
||||
RUN adduser --disabled-password --gecos '' --shell /bin/zsh rudeus
|
||||
|
||||
USER rudeus
|
||||
|
||||
WORKDIR /home/rudeus
|
||||
|
||||
COPY ./quests/helloworld/home /home/rudeus/
|
||||
COPY ./quests/helloworld/home /home/${USERNAME}/
|
||||
|
||||
CMD [ "/bin/zsh" ]
|
||||
@@ -74,4 +74,4 @@ stages:
|
||||
speaker: Unix Spirit
|
||||
content:
|
||||
- 恭喜您,我的指令官,您已成功解除了封印。
|
||||
- 請跟著在接下了關卡,一步步取回 Linux 之根吧!
|
||||
- 請跟著在接下來的關卡,一步步取回 Linux 之根吧!
|
||||
Reference in new issue
Block a user