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:
David Scott 2016-04-14 14:38:46 +01:00
parent 115373d42e
commit fb89526498
8 changed files with 10 additions and 15 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -1,4 +1,4 @@
package proxy package libproxy
import ( import (
"bytes" "bytes"

View File

@ -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"

View File

@ -1,4 +1,4 @@
package proxy package libproxy
import ( import (
"net" "net"

View File

@ -1,4 +1,4 @@
package proxy package libproxy
import ( import (
"io" "io"

View File

@ -1,4 +1,4 @@
package proxy package libproxy
import ( import (
"encoding/binary" "encoding/binary"