Skip to content

Commit

Permalink
build docker and update go and alpine versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhernandezb committed Jan 29, 2025
1 parent 8228ceb commit b839b55
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 12 deletions.
19 changes: 18 additions & 1 deletion .drone.star.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ steps:
- git fetch --tags
image: alpine/git
name: fetch
- commands:
- sleep 10
- ls -l /var/run/docker.sock
- test -S /var/run/docker.sock && echo 'Docker socket found' || echo 'Docker socket
missing'
image: alpine
name: debug_dind
volumes:
- name: dockersock
path: /var/run
- commands:
- ./scripts/go-test.sh
environment:
Expand All @@ -32,7 +42,14 @@ steps:
GOPROXY: http://goproxy
image: golang:1.23.5-alpine3.20
name: build
- commands:
- docker build -t publicawesome/stargaze:latest .
image: docker:24
name: build_docker
volumes:
- name: dockersock
path: /var/run
type: docker
volumes:
- name: dockersock
path: /var/run
temp: {}
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,6 @@ volumes:

---
kind: signature
hmac: 3f3de8b4a74ad66ba3729c9ba7799d2ca37680d68376ca8ce61faf11ac1c049b
hmac: af1d0bc62183b8e4e5701a0ad3eefa0d6eab0719a8d3805152dfdd6cdd0d4578

...
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker build . -t publicawesome/stargaze:latest
# docker run --rm -it publicawesome/stargaze:latest /bin/sh
FROM golang:1.23.5-alpine3.19 AS go-builder
FROM golang:1.23.5-alpine3.20 AS go-builder


RUN set -eux; apk add --no-cache ca-certificates build-base git;
Expand All @@ -26,7 +26,7 @@ RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build


# --------------------------------------------------------
FROM alpine:3.19
FROM alpine:3.20

COPY --from=go-builder /code/bin/starsd /usr/bin/starsd
RUN apk add -U --no-cache ca-certificates
Expand Down
56 changes: 48 additions & 8 deletions scripts/drone/pipelines/test_and_build.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ go_dev_image = "publicawesome/golang:1.23.5-devtooling"
go_image = "golang:1.23.5-alpine3.20"
wasmvm_version = "v2.1.4"
wasmvm_x86_84_hash = "a4a3d09b36fabb65b119d5ba23442c23694401fcbee4451fe6b7e22e325a4bac"
docker_image = "docker:24"
docker_dind_image = "docker:dind"

def pipeline_test_and_build(ctx):
return {
Expand All @@ -11,11 +13,14 @@ def pipeline_test_and_build(ctx):
"name": "test_and_build",
"steps": [
step_fetch(ctx),
step_debug_dind(ctx),
step_test(ctx),
step_build(ctx),
step_build_docker(ctx),

],
"volumes": [
volume_dockersock(ctx)
create_volume_dockersock(ctx)
],
"services": [
service_dind(ctx)
Expand Down Expand Up @@ -61,21 +66,56 @@ def step_build(ctx):
}


def step_build_docker(ctx):
return {
"name": "build_docker",
"image": docker_image,
"commands": [
"docker build -t publicawesome/stargaze:latest ."
],
"volumes": [
mount_volume(ctx, "dockersock", "/var/run")
]
}

def step_debug_dind(ctx):
return {
"name": "debug_dind",
"image": "alpine",
"commands": [
"sleep 10",
"ls -l /var/run/docker.sock",
"test -S /var/run/docker.sock && echo 'Docker socket found' || echo 'Docker socket missing'"
],
"volumes": [
mount_volume(ctx, "dockersock", "/var/run")
]
}

def service_dind(ctx):
return {
"name": "dind",
"image": "docker:dind",
"image": docker_dind_image,
"privileged": True,
"volumes": [
{
"name": "dockersock",
"path": "/var/run"
}
mount_volume(ctx, "dockersock", "/var/run")
]
}

def volume_dockersock(ctx):
def mount_volume(ctx, name, path):
return {
"name": name,
"path": path
}

def create_volume_dockersock(ctx):
return {
"name": "dockersock",
"path": "/var/run"
"temp": dict()
}

def volume_docker_export(ctx):
return {
"name": "docker_export",
"path": "/containers/export"
}

0 comments on commit b839b55

Please sign in to comment.