Skip to content

Commit 6c25e1c

Browse files
committed
chore(database): use podman replace docker
1 parent 4f05056 commit 6c25e1c

5 files changed

Lines changed: 28 additions & 35 deletions

File tree

.woodpecker/build-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ pipeline:
1313
image: bash
1414
commands:
1515
- export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_ARCH)
16-
- echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
17-
- make docker-build docker-immutable-push
16+
- echo $CONTAINER_PASSWORD | podman login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
17+
- make podman-build podman-immutable-push
1818
secrets:
1919
- codename
2020
- dev_registry

.woodpecker/manifest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ pipeline:
1919
- name: publish-manifest
2020
image: bash
2121
commands:
22-
- docker run --rm
22+
- podman run --rm
2323
-e PLUGIN_SPEC=.woodpecker/manifest.tmpl
2424
-e PLUGIN_USERNAME=$CONTAINER_USERNAME
2525
-e PLUGIN_PASSWORD=$CONTAINER_PASSWORD
2626
-e DRONE_TAG=$CI_COMMIT_TAG
2727
-v $(pwd):$(pwd)
2828
-w $(pwd)
29-
plugins/manifest
29+
docker.io/plugins/manifest
3030
secrets:
3131
- container_username
3232
- container_password

Makefile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Short name: Short name, following [a-zA-Z_], used all over the place.
22
# Some uses for short name:
3-
# - Docker image name
3+
# - Container image name
44
# - Kubernetes service, rc, pod, secret, volume names
55
SHORT_NAME := database
66
DRYCC_REGISTRY ?= ${DEV_REGISTRY}
@@ -15,23 +15,20 @@ SHELL_SCRIPTS = $(wildcard rootfs/usr/share/scripts/patroni/*)
1515
# and other build options
1616
DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
1717
DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH}
18-
DEV_ENV_CMD := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
19-
DEV_ENV_CMD_INT := docker run -it --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
18+
DEV_ENV_CMD := podman run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
19+
DEV_ENV_CMD_INT := podman run -it --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
2020

21-
all: docker-build docker-push
21+
all: podman-build podman-push
2222

2323
# For cases where we're building from local
2424
# We also alter the RC file to set the image name.
25-
docker-build:
26-
docker build ${DOCKER_BUILD_FLAGS} --build-arg CODENAME=${CODENAME} -t ${IMAGE} .
27-
docker tag ${IMAGE} ${MUTABLE_IMAGE}
28-
29-
docker-buildx:
30-
docker buildx build --build-arg CODENAME=${CODENAME} --platform ${PLATFORM} -t ${IMAGE} . --push
25+
podman-build:
26+
podman build --build-arg CODENAME=${CODENAME} -t ${IMAGE} .
27+
podman tag ${IMAGE} ${MUTABLE_IMAGE}
3128

3229
test: test-style
3330

3431
test-style:
3532
${DEV_ENV_CMD} shellcheck $(SHELL_SCRIPTS)
3633

37-
.PHONY: all docker-build docker-push test
34+
.PHONY: all podman-build podman-push test

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ For more information about the Drycc Workflow, please visit the main project pag
88

99
We welcome your input! If you have feedback, please submit an [issue][issues]. If you'd like to participate in development, please read the "Development" section below and submit a [pull request][prs].
1010

11-
# About
12-
13-
This component is a PostgreSQL database for use in Kubernetes. It builds on the official [postgres](https://registry.hub.docker.com/_/postgres/) Docker image. While it's intended for use inside of the Drycc Workflow open source [PaaS](https://en.wikipedia.org/wiki/Platform_as_a_service), it's flexible enough to be used as a standalone pod on any Kubernetes cluster or even as a standalone Docker container.
14-
1511
# Development
1612

1713
The Drycc project welcomes contributions from all developers. The high level process for development matches many other open source projects. See below for an outline.
@@ -27,7 +23,7 @@ The Drycc project welcomes contributions from all developers. The high level pro
2723
In order to develop and test this component in a Drycc cluster, you'll need the following:
2824

2925
* [GNU Make](https://www.gnu.org/software/make/)
30-
* [Docker](https://www.docker.com/) installed, configured and running
26+
* [Podman](https://podman.io/) installed, configured and running
3127
* A working Kubernetes cluster and `kubectl` installed and configured to talk to the cluster
3228
* If you don't have this setup, please see [the Kubernetes documentation][k8s-docs]
3329

@@ -39,27 +35,27 @@ If your feature or bugfix doesn't easily lend itself to unit/integration testing
3935

4036
### Dogfooding
4137

42-
Finally, we encourage you to [dogfood](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) this component while you're writing code on it. To do so, you'll need to build and push Docker images with your changes.
38+
Finally, we encourage you to [dogfood](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) this component while you're writing code on it. To do so, you'll need to build and push Container images with your changes.
4339

4440
This project has a [Makefile](https://github.com/drycc/postgres/blob/main/Makefile) that makes these tasks significantly easier. It requires the following environment variables to be set:
4541

46-
* `DRYCC_REGISTRY` - A Docker registry that you have push access to and your Kubernetes cluster can pull from
42+
* `DRYCC_REGISTRY` - A Container registry that you have push access to and your Kubernetes cluster can pull from
4743
* If this is [Docker Hub](https://hub.docker.com/), leave this variable empty
4844
* Otherwise, ensure it has a trailing `/`
49-
* `IMAGE_PREFIX` - The organization in the Docker repository. This defaults to `drycc`, but if you don't have access to that organization, set this to one you have push access to.
45+
* `IMAGE_PREFIX` - The organization in the Container repository. This defaults to `drycc`, but if you don't have access to that organization, set this to one you have push access to.
5046
* `SHORT_NAME` (optional) - The name of the image. This defaults to `postgres`
51-
* `VERSION` (optional) - The tag of the Docker image. This defaults to the current Git SHA (the output of `git rev-parse --short HEAD`)
47+
* `VERSION` (optional) - The tag of the Container image. This defaults to the current Git SHA (the output of `git rev-parse --short HEAD`)
5248

53-
Assuming you have these variables set correctly, run `make docker-build` to build the new image, and `make docker-push` to push it. Here is an example command that would push to `example.com/arschles/postgres:devel`:
49+
Assuming you have these variables set correctly, run `make podman-build` to build the new image, and `make podman-push` to push it. Here is an example command that would push to `example.com/arschles/postgres:devel`:
5450

5551
```console
5652
export DRYCC_REGISTRY=example.com/
5753
export IMAGE_PREFIX=arschles
5854
export VERSION=devel
59-
make docker-build docker-push
55+
make podman-build podman-push
6056
```
6157

62-
Note that you'll have to push your image to a Docker repository (`make docker-push`) in order for your Kubernetes cluster to pull the image. This is important for testing in your cluster.
58+
Note that you'll have to push your image to a Container repository (`make podman-push`) in order for your Kubernetes cluster to pull the image. This is important for testing in your cluster.
6359

6460

6561
[issues]: https://github.com/drycc/postgres/issues

versioning.mk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ info:
1010
@echo "Immutable tag: ${IMAGE}"
1111
@echo "Mutable tag: ${MUTABLE_IMAGE}"
1212

13-
.PHONY: docker-push
14-
docker-push: docker-immutable-push docker-mutable-push
13+
.PHONY: podman-push
14+
podman-push: podman-immutable-push podman-mutable-push
1515

16-
.PHONY: docker-immutable-push
17-
docker-immutable-push:
18-
docker push ${IMAGE}
16+
.PHONY: podman-immutable-push
17+
podman-immutable-push:
18+
podman push ${IMAGE}
1919

20-
.PHONY: docker-mutable-push
21-
docker-mutable-push:
22-
docker push ${MUTABLE_IMAGE}
20+
.PHONY: podman-mutable-push
21+
podman-mutable-push:
22+
podman push ${MUTABLE_IMAGE}

0 commit comments

Comments
 (0)