Go Compilation

Go Compilation
This commit is contained in:
Kroese 2023-04-23 20:01:01 +02:00 committed by GitHub
commit 3c4715a207
4 changed files with 8 additions and 7 deletions

View File

@ -1,10 +1,9 @@
FROM golang:1.20 AS builder FROM golang AS builder
COPY serial/ /src/serial/ COPY serial/ /src/serial/
WORKDIR /src/serial WORKDIR /src/serial
RUN go get -d -v golang.org/x/net/html RUN go mod download
RUN go get -d -v github.com/gorilla/mux
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /src/serial/main . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /src/serial/main .
FROM debian:bookworm-slim FROM debian:bookworm-slim

View File

@ -2,3 +2,4 @@ module vdsm-serial
go 1.20 go 1.20
require github.com/gorilla/mux v1.8.0

View File

@ -1 +1,2 @@
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=

View File

@ -1,15 +1,15 @@
package main package main
import ( import (
"bytes"
"encoding/binary"
"flag"
"fmt" "fmt"
"log" "log"
"net" "net"
"flag"
"bytes"
"strconv" "strconv"
"net/http" "net/http"
"math/rand" "math/rand"
"encoding/binary"
"github.com/gorilla/mux" "github.com/gorilla/mux"
) )