- add README - update build steps to use docker.sock
This commit is contained in:
parent
e8cc0ac6db
commit
8bd695fe7f
32
.drone.yml
32
.drone.yml
@ -4,10 +4,7 @@ name: build-docker-image
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: docker:20.10.24-dind
|
image: docker:20.10.24-cli
|
||||||
environment:
|
|
||||||
DOCKER_HOST: tcp://localhost:2375 # Docker daemon
|
|
||||||
DOCKER_TLS_CERTDIR: '' # Disable TLS to simplify DIND setup
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
@ -15,11 +12,36 @@ steps:
|
|||||||
- apk add --no-cache make bash git
|
- apk add --no-cache make bash git
|
||||||
- make build
|
- make build
|
||||||
|
|
||||||
|
- name: push
|
||||||
|
image: docker:20.10.24-cli
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache make bash git
|
||||||
|
- mkdir -p /root/.docker
|
||||||
|
- echo "${DOCKER_CONFIG_JSON}" > /root/.docker/config.json
|
||||||
|
- make push
|
||||||
|
|
||||||
|
- name: clean
|
||||||
|
image: docker:20.10.24-cli
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache make bash git
|
||||||
|
- make clean
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
temp: {}
|
host:
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
- source: docker_config_json
|
||||||
|
target: DOCKER_CONFIG_JSON
|
||||||
|
|||||||
6
README.md
Normal file
6
README.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Docker Image Build: almalinux base
|
||||||
|
|
||||||
|
[](https://droneci.query.consul/unkin/docker-almalinux-base)
|
||||||
|
|
||||||
|
This project provides a reproducible Docker image build process for `almalinux:8.10`, with custom YUM repository configurations and package installations. The build is automated using a `Makefile` and managed via Drone CI to ensure consistent and reliable Docker image builds.
|
||||||
|
|
||||||
8
makefile
8
makefile
@ -11,13 +11,13 @@ OWNER := unkin
|
|||||||
|
|
||||||
# Build the Docker image (without tags)
|
# Build the Docker image (without tags)
|
||||||
build:
|
build:
|
||||||
docker build --network=host -t $(IMAGE_NAME) .
|
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) .
|
||||||
|
|
||||||
# Tag the Docker image with the Git commit hash, the date, and 'latest'
|
# Tag the Docker image with the Git commit hash, the date, and 'latest'
|
||||||
tag:
|
tag:
|
||||||
docker tag $(IMAGE_NAME):latest $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
|
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
|
||||||
docker tag $(IMAGE_NAME):latest $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
|
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
|
||||||
docker tag $(IMAGE_NAME):latest $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
|
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
|
||||||
|
|
||||||
# Push the Docker image to a repository with all tags
|
# Push the Docker image to a repository with all tags
|
||||||
push: tag
|
push: tag
|
||||||
|
|||||||
Reference in New Issue
Block a user