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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
// Package proxy provides a network Proxy interface and implementations for TCP
// and UDP.
package proxy
package libproxy
import (
"fmt"

View File

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

View File

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

View File

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