mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-26 20:18:52 +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
|
RUN mkdir -p /go/src/proxy
|
||||||
WORKDIR /go/src/proxy
|
WORKDIR /go/src/proxy
|
||||||
|
|
||||||
COPY * /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/
|
|
||||||
|
|
||||||
ARG GOARCH
|
ARG GOARCH
|
||||||
ARG GOOS
|
ARG GOOS
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"pkg/proxy"
|
"libproxy"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
sendError(err)
|
sendError(err)
|
||||||
}
|
}
|
||||||
p, err := proxy.NewProxy(host, container)
|
p, err := libproxy.NewProxy(host, container)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
unexposePort(host)
|
unexposePort(host)
|
||||||
sendError(err)
|
sendError(err)
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"pkg/proxy"
|
"libproxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// sendError signals the error to the parent and quits the process.
|
// 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
|
return host, port, container
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleStopSignals(p proxy.Proxy) {
|
func handleStopSignals(p libproxy.Proxy) {
|
||||||
s := make(chan os.Signal, 10)
|
s := make(chan os.Signal, 10)
|
||||||
signal.Notify(s, os.Interrupt, syscall.SIGTERM, syscall.SIGSTOP)
|
signal.Notify(s, os.Interrupt, syscall.SIGTERM, syscall.SIGSTOP)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package proxy
|
package libproxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
@ -1,6 +1,6 @@
|
|||||||
// Package proxy provides a network Proxy interface and implementations for TCP
|
// Package proxy provides a network Proxy interface and implementations for TCP
|
||||||
// and UDP.
|
// and UDP.
|
||||||
package proxy
|
package libproxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package proxy
|
package libproxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
@ -1,4 +1,4 @@
|
|||||||
package proxy
|
package libproxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
@ -1,4 +1,4 @@
|
|||||||
package proxy
|
package libproxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
Loading…
Reference in New Issue
Block a user