Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
damoon committed Nov 17, 2020
1 parent 37b2cac commit 1883ae9
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Building images remotely allows to work from locations with slow internet upstre

## Use case 1

Using docker cli to build and push an image.
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
Expand All @@ -19,7 +19,7 @@ docker build -t registry/user/image:tag .

## Use case 2

Using tilt to set up and test an environment.
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
Expand All @@ -28,11 +28,11 @@ tilt ci

## Use case 3

Using tilt to set up a development environment without a running local docker.
Using tilt to set up a development environment without running a local docker daemon.

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

_Terminal 2_
Expand Down
6 changes: 3 additions & 3 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ allow_k8s_contexts(['test', 'ci'])
load('ext://min_tilt_version', 'min_tilt_version')
min_tilt_version('0.15.0') # includes fix for auto_init+False with tilt ci

include('./services/Tiltfile')
include('./service-dependencies/Tiltfile')
include('./tests/Tiltfile')

k8s_yaml('deployment/config.yaml')
k8s_yaml('deployment/kubernetes.yaml')

if os.environ.get('PROD', '') == '':
docker_build(
'wedding-image',
'davedamoon/wedding:latest',
'.',
dockerfile='deployment/Dockerfile',
target='build-env',
Expand All @@ -38,7 +38,7 @@ if os.environ.get('PROD', '') == '':
)
else:
docker_build(
'backend-image',
'davedamoon/wedding:latest',
'.',
dockerfile='deployment/Dockerfile',
build_args={"SOURCE_BRANCH":"development", "SOURCE_COMMIT":"development"},
Expand Down
9 changes: 5 additions & 4 deletions deployment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ RUN go mod download
ARG SOURCE_BRANCH
ARG SOURCE_COMMIT

ENV CGO_ENABLED=0
ENV GOOS=linux

COPY cmd cmd
COPY pkg pkg
RUN CGO_ENABLED=0 \
GOOS=linux \
go install -ldflags="-X main.gitRef=${SOURCE_BRANCH} -X main.gitHash=${SOURCE_COMMIT}" -installsuffix cgo ./cmd/wedding
RUN go install -ldflags="-X main.gitRef=${SOURCE_BRANCH} -X main.gitHash=${SOURCE_COMMIT}" -installsuffix cgo ./cmd/wedding

###############################################################
FROM alpine:3.12.1
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=build-env /go/bin/wedding .
ENTRYPOINT [ "./wedding", "server" ]
ENTRYPOINT [ "./wedding", "server" ]
1 change: 0 additions & 1 deletion deployment/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: buildkitd-config
data:
buildkitd.toml: |
debug = true
[worker.oci]
rootless = true
Expand Down
2 changes: 1 addition & 1 deletion deployment/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
serviceAccountName: wedding
containers:
- name: wedding
image: wedding-image
image: davedamoon/wedding:latest
args:
- --s3-endpoint=minio:9000
- --s3-access-key-file=/secret/minio/MINIO_ACCESS_KEY
Expand Down
2 changes: 0 additions & 2 deletions pkg/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ mkdir ~/context && cd ~/context
wget -O - "%s" | tar -xf -
set -x
export BUILDKITD_FLAGS="--oci-worker-no-process-sandbox"
export BUILDCTL_CONNECT_RETRIES_MAX=100
buildctl-daemonless.sh \
build \
--frontend dockerfile.v0 \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1883ae9

Please sign in to comment.