mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 11:00:25 +00:00
proxy: simply the Dockerfile by shuffling code under vendor/
Note there is a slight name clash between the final binary 'proxy' and the library formerly known as 'proxy'. Resolve this by calling the library 'libproxy'. Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
parent
115373d42e
commit
fb89526498
@ -3,12 +3,7 @@ FROM golang:alpine
|
||||
RUN mkdir -p /go/src/proxy
|
||||
WORKDIR /go/src/proxy
|
||||
|
||||
COPY * /go/src/proxy/
|
||||
|
||||
RUN mkdir -p /go/src/pkg/proxy
|
||||
COPY pkg/* /go/src/pkg/proxy/
|
||||
RUN mkdir -p /go/src/vendor/github.com/Sirupsen/logrus
|
||||
COPY vendor/github.com/Sirupsen/logrus/* /go/src/vendor/github.com/Sirupsen/logrus/
|
||||
COPY ./ /go/src/proxy/
|
||||
|
||||
ARG GOARCH
|
||||
ARG GOOS
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"pkg/proxy"
|
||||
"libproxy"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -17,7 +17,7 @@ func main() {
|
||||
if err != nil {
|
||||
sendError(err)
|
||||
}
|
||||
p, err := proxy.NewProxy(host, container)
|
||||
p, err := libproxy.NewProxy(host, container)
|
||||
if err != nil {
|
||||
unexposePort(host)
|
||||
sendError(err)
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"pkg/proxy"
|
||||
"libproxy"
|
||||
)
|
||||
|
||||
// sendError signals the error to the parent and quits the process.
|
||||
@ -59,7 +59,7 @@ func parseHostContainerAddrs() (host net.Addr, port int, container net.Addr) {
|
||||
return host, port, container
|
||||
}
|
||||
|
||||
func handleStopSignals(p proxy.Proxy) {
|
||||
func handleStopSignals(p libproxy.Proxy) {
|
||||
s := make(chan os.Signal, 10)
|
||||
signal.Notify(s, os.Interrupt, syscall.SIGTERM, syscall.SIGSTOP)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package proxy
|
||||
package libproxy
|
||||
|
||||
import (
|
||||
"bytes"
|
@ -1,6 +1,6 @@
|
||||
// Package proxy provides a network Proxy interface and implementations for TCP
|
||||
// and UDP.
|
||||
package proxy
|
||||
package libproxy
|
||||
|
||||
import (
|
||||
"fmt"
|
@ -1,4 +1,4 @@
|
||||
package proxy
|
||||
package libproxy
|
||||
|
||||
import (
|
||||
"net"
|
@ -1,4 +1,4 @@
|
||||
package proxy
|
||||
package libproxy
|
||||
|
||||
import (
|
||||
"io"
|
@ -1,4 +1,4 @@
|
||||
package proxy
|
||||
package libproxy
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
Loading…
Reference in New Issue
Block a user