mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
refactor: bind /proc and mount volumes with nsenter
This commit is contained in:
@@ -72,7 +72,7 @@ export const RepositorySnapshotsTabContent = ({ repository }: Props) => {
|
||||
);
|
||||
}
|
||||
|
||||
if (isLoading && !data) {
|
||||
if (isLoading && !data && !error) {
|
||||
return (
|
||||
<Card>
|
||||
<CardContent className="flex items-center justify-center py-12">
|
||||
|
||||
@@ -9,7 +9,7 @@ import { logger } from "../../../utils/logger";
|
||||
const execFile = promisify(execFileCb);
|
||||
|
||||
export const executeMount = async (args: string[]): Promise<void> => {
|
||||
const { stderr } = await execFile("mount", args, {
|
||||
const { stderr } = await execFile("nsenter", ["--mount=/host/proc/1/ns/mnt", "mount", ...args], {
|
||||
timeout: OPERATION_TIMEOUT,
|
||||
maxBuffer: 1024 * 1024,
|
||||
});
|
||||
@@ -20,7 +20,7 @@ export const executeMount = async (args: string[]): Promise<void> => {
|
||||
};
|
||||
|
||||
export const executeUnmount = async (path: string): Promise<void> => {
|
||||
const { stderr } = await execFile("umount", ["-l", "-f", path], {
|
||||
const { stderr } = await execFile("nsenter", ["--mount=/host/proc/1/ns/mnt", "umount", "-l", "-f", path], {
|
||||
timeout: OPERATION_TIMEOUT,
|
||||
maxBuffer: 1024 * 1024,
|
||||
});
|
||||
|
||||
@@ -6,19 +6,17 @@ services:
|
||||
target: development
|
||||
container_name: ironmount
|
||||
restart: unless-stopped
|
||||
cap_add:
|
||||
- SYS_ADMIN
|
||||
privileged: true
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
ports:
|
||||
- "4096:4097"
|
||||
devices:
|
||||
- /dev/fuse:/dev/fuse
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /run/docker/plugins:/run/docker/plugins
|
||||
- /var/lib/ironmount/volumes/:/var/lib/ironmount/volumes:rshared
|
||||
- /var/lib/ironmount/volumes/:/var/lib/ironmount/volumes:rslave
|
||||
- /var/lib/repositories/:/var/lib/repositories
|
||||
- /proc:/host/proc:ro
|
||||
- ironmount_data:/data
|
||||
|
||||
- ./apps/client/app:/app/apps/client/app
|
||||
@@ -31,16 +29,15 @@ services:
|
||||
target: production
|
||||
container_name: ironmount
|
||||
restart: unless-stopped
|
||||
cap_add:
|
||||
- SYS_ADMIN
|
||||
privileged: true
|
||||
ports:
|
||||
- "4096:4096"
|
||||
devices:
|
||||
- /dev/fuse:/dev/fuse
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /run/docker/plugins:/run/docker/plugins
|
||||
- /var/lib/ironmount/volumes/:/var/lib/ironmount/volumes:rshared
|
||||
- /var/lib/ironmount/volumes/:/var/lib/ironmount/volumes:rslave
|
||||
- /var/lib/repositories/:/var/lib/repositories
|
||||
- /proc:/host/proc:ro
|
||||
- ironmount_data:/data
|
||||
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user