Skip to content

Commit 935e3cd

Browse files
committed
add vendor and boxfile so we can run in nanobox
1 parent c779054 commit 935e3cd

File tree

208 files changed

+15428
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+15428
-0
lines changed

boxfile.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
run.config:
2+
image: nanobox/build
3+
engine: golang
4+
engine.config:
5+
package: github.com/nanobox-io/golang-docker-client
6+
extra_steps:
7+
- "go get github.com/kardianos/govendor"

container.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
dockContainer "github.com/docker/engine-api/types/container"
1010
dockNetwork "github.com/docker/engine-api/types/network"
1111
"github.com/docker/engine-api/types/strslice"
12+
"github.com/docker/go-connections/nat"
1213
)
1314

1415
type ContainerConfig struct {
@@ -30,6 +31,7 @@ type ContainerConfig struct {
3031
CPUShares int64 `json:"cpu_shares"`
3132
RestartPolicy string `json:"restart_policy"`
3233
RestartAttempts int `json:"restart_attempts"`
34+
Ports []string `json:"ports"`
3335
}
3436

3537
// create a container from the user specification
@@ -38,6 +40,8 @@ func CreateContainer(conf ContainerConfig) (dockType.ContainerJSON, error) {
3840
// conf.Cmd = []string{"/bin/sleep", "3650d"}
3941
// }
4042

43+
ports, portBindings, _ := nat.ParsePortSpecs(conf.Ports)
44+
4145
// create a configurable restart policy with a default 'unless stopped' behavior
4246
restartPolicy := dockContainer.RestartPolicy{Name: "unless-stopped"}
4347
switch conf.RestartPolicy {
@@ -56,6 +60,7 @@ func CreateContainer(conf ContainerConfig) (dockType.ContainerJSON, error) {
5660
Labels: conf.Labels,
5761
NetworkDisabled: false,
5862
Image: conf.Image,
63+
ExposedPorts: ports,
5964
}
6065

6166
hostConfig := &dockContainer.HostConfig{
@@ -70,6 +75,7 @@ func CreateContainer(conf ContainerConfig) (dockType.ContainerJSON, error) {
7075
MemorySwap: conf.MemorySwap,
7176
CPUShares: conf.CPUShares,
7277
},
78+
PortBindings: portBindings,
7379
}
7480

7581
netConfig := &dockNetwork.NetworkingConfig{}

vendor/github.com/Sirupsen/logrus/CHANGELOG.md

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Sirupsen/logrus/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)