Skip to content

Commit 0723d33

Browse files
committed
chore(registry): use podman replace docker
1 parent 2aa2090 commit 0723d33

8 files changed

Lines changed: 36 additions & 39 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: 9 additions & 12 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, deployment, pod names
55
SHORT_NAME := registry
66
DRYCC_REGISTRY ?= ${DEV_REGISTRY}
@@ -17,7 +17,7 @@ SHELL_SCRIPTS = $(wildcard rootfs/bin/* _scripts/*.sh contrib/ci/*.sh)
1717
# and other build options
1818
DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
1919
DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH}
20-
DEV_ENV_PREFIX := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
20+
DEV_ENV_PREFIX := podman run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
2121
DEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}
2222
LDFLAGS := "-s -w -X main.version=${VERSION}"
2323
BINDIR := ./rootfs/opt/registry/sbin
@@ -29,31 +29,28 @@ endif
2929
all:
3030
@echo "Use a Makefile to control top-level building of the project."
3131

32-
build: check-docker
32+
build: check-podman
3333
mkdir -p ${BINDIR}
3434
$(MAKE) build-binary
3535

3636
# For cases where we're building from local
3737
# We also alter the RC file to set the image name.
38-
docker-build: check-docker
39-
docker build ${DOCKER_BUILD_FLAGS} --build-arg CODENAME=${CODENAME} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} .
40-
docker tag ${IMAGE} ${MUTABLE_IMAGE}
41-
42-
docker-buildx: check-docker
43-
docker buildx build --build-arg CODENAME=${CODENAME} --platform ${PLATFORM} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} . --push
38+
podman-build: check-podman
39+
podman build --build-arg CODENAME=${CODENAME} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} .
40+
podman tag ${IMAGE} ${MUTABLE_IMAGE}
4441

4542
build-binary:
4643
${DEV_ENV_CMD} go build -ldflags ${LDFLAGS} -o $(BINDIR)/${SHORT_NAME} main.go
4744
$(call check-static-binary,$(BINDIR)/${SHORT_NAME})
4845
${DEV_ENV_CMD} upx -9 --brute $(BINDIR)/${SHORT_NAME}
4946

50-
test: check-docker docker-build test-style
47+
test: check-podman podman-build test-style
5148
contrib/ci/test.sh ${IMAGE}
5249

5350
test-style:
5451
${DEV_ENV_CMD} shellcheck $(SHELL_SCRIPTS)
5552

56-
deploy: check-kubectl docker-build docker-push
53+
deploy: check-kubectl podman-build podman-push
5754
kubectl --namespace=drycc patch deployment drycc-$(SHORT_NAME) --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"$(IMAGE)"}]'
5855

59-
.PHONY: all build build-binary docker-build test test-style deploy
56+
.PHONY: all build build-binary podman-build test test-style deploy

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ We welcome your input! If you have feedback, please submit an [issue][issues]. I
1212

1313
# About
1414

15-
The registry is a [Docker registry](https://docs.docker.com/registry/) component for use in Kubernetes. While it's intended for use inside of the Drycc 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.
15+
The registry is a [Container registry](https://github.com/distribution/distribution) component for use in Kubernetes. While it's intended for use inside of the Drycc 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.
1616

17-
If you decide to use this component standalone, you can host your own Docker registry in your own Kubernetes cluster.
17+
If you decide to use this component standalone, you can host your own Container registry in your own Kubernetes cluster.
1818

19-
The Docker image that this repository builds is based on [the official Docker v2 registry image](https://github.com/docker/distribution).
19+
The Container image that this repository builds is based on [the official Container v2 registry image](https://github.com/distribution/distribution).
2020

2121
# Development
2222

@@ -49,7 +49,7 @@ $ export IMAGE_PREFIX=youruser/ # if using Quay or Dockerhub
4949
To build and push the image run:
5050

5151
```console
52-
$ make docker-build docker-push
52+
$ make podman-build podman-push
5353
```
5454

5555
To deploy the image via patching the registry deployment run:

charts/registry/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- name: common
77
repository: oci://registry.drycc.cc/charts
88
version: ~1.1.2
9-
description: Docker registry for Drycc Workflow.
9+
description: Container registry for Drycc Workflow.
1010
maintainers:
1111
- name: Drycc Team
1212
email: engineering@drycc.com

contrib/ci/test.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ set -eoxf pipefail
55
s3Accesskey=drycc
66
s3Secretkey=123456789
77

8-
STORAGE_JOB=$(docker run -d --name storage \
8+
STORAGE_JOB=$(podman run -d --name storage \
99
-e DRYCC_STORAGE_ACCESSKEY=$s3Accesskey \
1010
-e DRYCC_STORAGE_SECRETKEY=$s3Secretkey \
1111
"${DEV_REGISTRY}"/drycc/storage:canary minio server /data/storage/ --console-address :9001)
1212

1313
sleep 5
14-
docker logs "${STORAGE_JOB}"
14+
podman logs "${STORAGE_JOB}"
1515

16-
STORAGE_IP=$(docker inspect --format "{{ .NetworkSettings.IPAddress }}" "${STORAGE_JOB}")
16+
STORAGE_IP=$(podman inspect --format "{{ .NetworkSettings.IPAddress }}" "${STORAGE_JOB}")
1717

18-
JOB=$(docker run --add-host storage:"${STORAGE_IP}" \
18+
JOB=$(podman run --add-host storage:"${STORAGE_IP}" \
1919
-d \
2020
-p 5000:5000 \
2121
-e REGISTRY_HTTP_SECRET=drycc \
@@ -32,6 +32,6 @@ JOB=$(docker run --add-host storage:"${STORAGE_IP}" \
3232
# let the registry run for a few seconds
3333
sleep 5
3434
# check that the registry is still up
35-
docker logs "${JOB}"
36-
docker ps -q --no-trunc=true | grep "${JOB}"
37-
docker rm -f "${JOB}" "${STORAGE_JOB}"
35+
podman logs "${JOB}"
36+
podman ps -q --no-trunc=true | grep "${JOB}"
37+
podman rm -f "${JOB}" "${STORAGE_JOB}"

includes.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
check-docker:
2-
@if [ -z $$(which docker) ]; then \
3-
echo "Missing \`docker\` client which is required for development"; \
1+
check-podman:
2+
@if [ -z $$(which podman) ]; then \
3+
echo "Missing \`podman\` client which is required for development"; \
44
exit 2; \
55
fi
66

versioning.mk

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

14-
.PHONY: docker-push
15-
docker-push: docker-immutable-push docker-mutable-push
14+
.PHONY: podman-push
15+
podman-push: podman-immutable-push podman-mutable-push
1616

17-
.PHONY: docker-immutable-push
18-
docker-immutable-push:
19-
docker push ${IMAGE}
17+
.PHONY: podman-immutable-push
18+
podman-immutable-push:
19+
podman push ${IMAGE}
2020

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

0 commit comments

Comments
 (0)