Skip to content

Commit

Permalink
Fix and rename build date
Browse files Browse the repository at this point in the history
- rename from BASE_BUILD_DATE to BASE_CREATED to match label name
- noticed it wasn't a valid utc iso timestamp, so fixed that
- noticed we are using a weird hybrid of make and just, so fixed that
  • Loading branch information
bloodearnest committed Oct 23, 2024
1 parent 6411326 commit f2563c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ EOF

# record build info so downstream images know about the base image they were
# built from
ARG BASE_BUILD_DATE
ARG BASE_CREATED
ARG BASE_GITREF
LABEL org.opensafely.base.created=$BASE_BUILD_DATE \
LABEL org.opensafely.base.created=$BASE_CREATED \
org.opensafely.base.gitref=$BASE_GITREF

FROM base-docker as base-action
Expand Down
12 changes: 10 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@ export ACTION_IMAGE_NAME := env_var_or_default('ACTION_IMAGE_NAME', "base-action
_default:
@just --list

build:
make build
# build all images
build *args:
#!/bin/bash
export DOCKER_BUILDKIT=1
export BASE_CREATED=$(date --utc +'%Y-%m-%dT%H:%M:%S+00:00')
export BASE_GITREF=$(git rev-parse --short HEAD)
docker compose build --pull {{ args }}

clean-build: (build "--no-cache")

# hadolint the Dockerfile
lint:
@docker pull hadolint/hadolint
@docker run --rm -i hadolint/hadolint < Dockerfile

# build and test all images
test: build
#!/bin/bash
set -euxo pipefail
Expand Down
12 changes: 0 additions & 12 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
# this makes the image work for later cache_from: usage
- BUILDKIT_INLINE_CACHE=1
# env vars supplied by make/just
- BASE_BUILD_DATE
- BASE_CREATED
- BASE_GITREF
init: true

Expand Down

0 comments on commit f2563c5

Please sign in to comment.