Skip to content

Commit

Permalink
use port 2375 instead of 2376
Browse files Browse the repository at this point in the history
  • Loading branch information
damoon committed Dec 10, 2021
1 parent 5b661d4 commit 274d15d
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Building images remotely allows to work from locations with slow internet upstre
Using docker cli to build and push an image from within gitlab ci, without a running docker daemon.

``` bash
export DOCKER_HOST=tcp://wedding:2376
export DOCKER_HOST=tcp://wedding:2375
docker build -t registry/user/image:tag .
```

Expand All @@ -22,7 +22,7 @@ docker build -t registry/user/image:tag .
Using tilt to set up and test an environment from within gitlab ci, without a running docker daemon.

``` bash
export DOCKER_HOST=tcp://wedding:2376
export DOCKER_HOST=tcp://wedding:2375
tilt ci
```

Expand All @@ -32,11 +32,11 @@ Using tilt to set up a development environment without running a local docker da

_Terminal 1_
``` bash
kubectl port-forward svc/wedding 2376:2376
kubectl port-forward svc/wedding 2375:2375
```

_Terminal 2_
``` bash
export DOCKER_HOST=tcp://127.0.0.1:2376
export DOCKER_HOST=tcp://127.0.0.1:2375
tilt up
```
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ docker_build(

k8s_resource(
'wedding',
port_forwards=['12376:2376'],
port_forwards=['12375:2375'],
resource_deps=['minio-buckets', 'registry', 'docker-hub-mirror'],
labels=["application"],
)
2 changes: 1 addition & 1 deletion cmd/wedding/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
Name: "server",
Usage: "Start the server.",
Flags: []cli.Flag{
&cli.StringFlag{Name: "addr", Value: ":2376", Usage: "Address to run service on."},
&cli.StringFlag{Name: "addr", Value: ":2375", Usage: "Address to run service on."},
&cli.StringFlag{Name: "s3-endpoint", Required: true, Usage: "s3 endpoint."},
&cli.StringFlag{Name: "s3-access-key-file", Required: true, Usage: "Path to s3 access key."},
&cli.StringFlag{Name: "s3-secret-key-file", Required: true, Usage: "Path to s3 secret access key."},
Expand Down
6 changes: 3 additions & 3 deletions deployment/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
app: wedding
ports:
- name: wedding
port: 2376
port: 2375
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -39,11 +39,11 @@ spec:
value: "yes"
ports:
- name: wedding
containerPort: 2376
containerPort: 2375
readinessProbe:
httpGet:
path: /_ping
port: 2376
port: 2375
volumeMounts:
- name: minio
mountPath: "/secret/minio"
Expand Down
6 changes: 3 additions & 3 deletions hack/sniffer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Sniffer simplifies the implementation of the [Docker API](https://docs.docker.com/engine/api/v1.40/#operation/ImageBuild).

It is sitting as a HTTP proxy (127.0.07:23765 -> 127.0.0.1:2376) in between dockerd and a docker client.
It is sitting as a HTTP proxy (127.0.07:23755 -> 127.0.0.1:2375) in between dockerd and a docker client.

The endpoint 127.0.0.1:2376 needs to be enabled for dockerd.
The endpoint 127.0.0.1:2375 needs to be enabled for dockerd.

It prints requests and responses to stdout.

Expand All @@ -18,5 +18,5 @@ go run ./hack/sniffer.go

_Terminal 2_
``` bash
DOCKER_HOST=tcp://127.0.07:23765 docker build .
DOCKER_HOST=tcp://127.0.07:23755 docker build .
```
6 changes: 3 additions & 3 deletions hack/sniffer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import (
func main() {
http.HandleFunc("/", sniffer)

log.Println("proxy http traffic from :23765 to http://127.0.0.1:2376")
log.Println("proxy http traffic from :23755 to http://127.0.0.1:2375")

if err := http.ListenAndServe(":23765", nil); err != nil {
if err := http.ListenAndServe(":23755", nil); err != nil {
log.Fatalf("listen and serve: %v", err)
}
}

func sniffer(w http.ResponseWriter, r *http.Request) {
err := serveReverseProxy("http://127.0.0.1:2376", w, r)
err := serveReverseProxy("http://127.0.0.1:2375", w, r)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
Expand Down
2 changes: 1 addition & 1 deletion tests/docker-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!bash
set -uexo pipefail
export DOCKER_HOST=tcp://127.0.0.1:12376
export DOCKER_HOST=tcp://127.0.0.1:12375
export DOCKER_BUILDKIT=0
until docker version; do sleep 1; done

Expand Down
2 changes: 1 addition & 1 deletion tests/docker-inspect.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!bash
set -uexo pipefail
export DOCKER_HOST=tcp://127.0.0.1:12376
export DOCKER_HOST=tcp://127.0.0.1:12375
export DOCKER_BUILDKIT=0
until docker version; do sleep 1; done

Expand Down
2 changes: 1 addition & 1 deletion tests/docker-max-memory.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!bash
set -uexo pipefail
export DOCKER_HOST=tcp://127.0.0.1:12376
export DOCKER_HOST=tcp://127.0.0.1:12375
export DOCKER_BUILDKIT=0
until docker version; do sleep 1; done

Expand Down
2 changes: 1 addition & 1 deletion tests/docker-pull-tag-push.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!bash
set -uexo pipefail
export DOCKER_HOST=tcp://127.0.0.1:12376
export DOCKER_HOST=tcp://127.0.0.1:12375
export DOCKER_BUILDKIT=0
until docker version; do sleep 1; done

Expand Down
2 changes: 1 addition & 1 deletion tests/tilt-ci.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!bash
set -uexo pipefail
export DOCKER_HOST=tcp://127.0.0.1:12376
export DOCKER_HOST=tcp://127.0.0.1:12375
export DOCKER_BUILDKIT=0
until docker version; do sleep 1; done

Expand Down
2 changes: 1 addition & 1 deletion tests/tilt/verify-a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ spec:
sleep 5
env:
- name: "DOCKER_HOST"
value: "tcp://wedding:2376"
value: "tcp://wedding:2375"
restartPolicy: Never
2 changes: 1 addition & 1 deletion tests/tilt/verify-b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ spec:
sleep 5
env:
- name: "DOCKER_HOST"
value: "tcp://wedding:2376"
value: "tcp://wedding:2375"
restartPolicy: Never

0 comments on commit 274d15d

Please sign in to comment.