mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: remove unnecessary quest Dockerfiles
This commit is contained in:
1 parent
247f03b71a
commit
a4ed4cf533
16 files changed
+8
-49
No files matched your search
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY home ${HOME}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY home ${HOME}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
USER root
|
|
||||||
COPY home .
|
|
||||||
RUN chown -R ${USERNAME}:${USERNAME} .
|
|
||||||
|
|
||||||
USER ${USERNAME}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY home ${HOME}
|
|
||||||
@@ -4,6 +4,7 @@ USERNAME=commander
|
|||||||
|
|
||||||
if ! id -u ${USERNAME} >/dev/null 2>&1; then
|
if ! id -u ${USERNAME} >/dev/null 2>&1; then
|
||||||
adduser --disabled-password --gecos '' --shell /bin/zsh ${USERNAME} && \
|
adduser --disabled-password --gecos '' --shell /bin/zsh ${USERNAME} && \
|
||||||
|
find / -name ".gitkeep" -type f -exec rm -f {} +
|
||||||
mkdir -p /home/${USERNAME}/.ssh && \
|
mkdir -p /home/${USERNAME}/.ssh && \
|
||||||
cp /ssh_key.pub /home/${USERNAME}/.ssh/authorized_keys && \
|
cp /ssh_key.pub /home/${USERNAME}/.ssh/authorized_keys && \
|
||||||
chmod 600 /home/${USERNAME}/.ssh/authorized_keys && \
|
chmod 600 /home/${USERNAME}/.ssh/authorized_keys && \
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
USER root
|
|
||||||
COPY home ${HOME}
|
|
||||||
|
|
||||||
USER commander
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY home ${HOME}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY home ${HOME}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY --chown=${USERNAME} home ${HOME}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY home ${HOME}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY home ${HOME}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY --chown=${USERNAME} home ${HOME}
|
|
||||||
RUN mkdir empty
|
|
||||||
Whitespace-only changes.
@@ -1,3 +0,0 @@
|
|||||||
FROM linuxodyssey/quest-base
|
|
||||||
|
|
||||||
COPY home ${HOME}
|
|
||||||
@@ -28,20 +28,21 @@ const newContainerOptions = (
|
|||||||
|
|
||||||
export async function createContainer(
|
export async function createContainer(
|
||||||
name: string,
|
name: string,
|
||||||
|
questId: string,
|
||||||
imageId: string
|
imageId: string
|
||||||
): Promise<Docker.Container> {
|
): Promise<Docker.Container> {
|
||||||
let binds: string[] = [
|
let binds: string[] = [
|
||||||
`${config.projectRoot}/config/ssh_key.pub:/ssh_key.pub:ro`,
|
`${config.projectRoot}/config/ssh_key.pub:/ssh_key.pub:ro`,
|
||||||
`${config.projectRoot}/quests/entrypoint.sh:/entrypoint.sh:ro`,
|
`${config.projectRoot}/quests/entrypoint.sh:/entrypoint.sh:ro`,
|
||||||
]
|
]
|
||||||
if (await questHomeExists(imageId)) {
|
if (await questHomeExists(questId)) {
|
||||||
logger.info('Mounting quest home', imageId)
|
logger.info('Mounting quest home', questId)
|
||||||
binds.push(`${config.projectRoot}/quests/${imageId}/home:/etc/skel:ro`)
|
binds.push(`${config.projectRoot}/quests/${questId}/home:/etc/skel:ro`)
|
||||||
}
|
}
|
||||||
if (!config.isProduction && config.docker.mountQuest && imageId !== 'base') {
|
if (!config.isProduction && config.docker.mountQuest && imageId !== 'base') {
|
||||||
logger.info('Mounting quest folder', imageId)
|
logger.info('Mounting quest folder', questId)
|
||||||
binds = [
|
binds = [
|
||||||
`${config.projectRoot}/quests/${imageId}/home:/home/commander`,
|
`${config.projectRoot}/quests/${questId}/home:/home/commander`,
|
||||||
`${config.projectRoot}/packages/container:/usr/local/lib/container`,
|
`${config.projectRoot}/packages/container:/usr/local/lib/container`,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export async function createNewSession(
|
|||||||
|
|
||||||
const container = await createContainer(
|
const container = await createContainer(
|
||||||
`quest-${quest.id}-${user.username}-${Date.now()}`,
|
`quest-${quest.id}-${user.username}-${Date.now()}`,
|
||||||
|
quest.id,
|
||||||
quest.image
|
quest.image
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user