Add dockerfile for running in docker
This commit is contained in:
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
FROM golang:1.21-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go build -o proxmox-cloud-image
|
||||
|
||||
FROM ubuntu:22.04
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
qemu-utils \
|
||||
libguestfs-tools \
|
||||
openssh-client \
|
||||
ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /app/proxmox-cloud-image /usr/local/bin/
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
ENTRYPOINT ["proxmox-cloud-image"]
|
||||
37
README.md
37
README.md
@@ -61,6 +61,43 @@ Setelah install, bisa langsung dipanggil dari mana aja:
|
||||
proxmox-cloud-image -h
|
||||
```
|
||||
|
||||
### Windows (WSL2):
|
||||
|
||||
```bash
|
||||
# Install WSL2 Ubuntu
|
||||
wsl --install
|
||||
|
||||
# Masuk ke WSL
|
||||
wsl
|
||||
|
||||
# Install dependencies
|
||||
sudo apt update
|
||||
sudo apt install qemu-utils libguestfs-tools golang-go
|
||||
|
||||
# Clone dan install
|
||||
git clone <repo-url>
|
||||
cd cloud-image
|
||||
sudo ./install.sh
|
||||
```
|
||||
|
||||
### Docker (Cross-platform):
|
||||
|
||||
Build image:
|
||||
```bash
|
||||
docker build -t proxmox-cloud-image .
|
||||
```
|
||||
|
||||
Jalankan:
|
||||
```bash
|
||||
docker run --rm -v $(pwd)/configs:/workspace proxmox-cloud-image -config /workspace/config.yaml
|
||||
```
|
||||
|
||||
Atau buat alias:
|
||||
```bash
|
||||
alias proxmox-cloud-image='docker run --rm -v $(pwd):/workspace proxmox-cloud-image'
|
||||
proxmox-cloud-image -h
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Menggunakan CLI flags:
|
||||
|
||||
Reference in New Issue
Block a user