From 4080ba7ac1b0a10aa7d995d8c7876b4b02ae0b30 Mon Sep 17 00:00:00 2001 From: bumu Date: Fri, 15 Dec 2023 09:31:56 +0800 Subject: [PATCH] release v0.0.1 --- .../Dockerfile | 0 apkbuild/Makefile | 41 ++++++++++++++ apkbuild/README.md | 8 +++ apkbuild/docker-compose.yaml | 18 ++++++ asp/Dockerfile | 1 - {dockerfile => base}/Dockerfile.alpine.common | 0 {dockerfile => base}/Dockerfile.ubuntu.common | 0 base/README.md | 11 ++++ dockerfile/Dockerfile.alpine.base | 20 ------- dockerfile/Dockerfile.alpine.github | 46 --------------- dockerfile/Dockerfile.debian.github | 56 ------------------- dockerfile/Dockerfile.debian.lint | 46 --------------- dockerfile/Dockerfile.debian.webhook | 13 ----- dockerfile/Dockerfile.ubuntu.base | 9 --- dockerfile/Dockerfile.ubuntu.vue | 27 --------- fpm/Makefile | 19 ------- fpmbuild/Dockerfile | 35 ++++++++++++ fpmbuild/Makefile | 41 ++++++++++++++ {fpm => fpmbuild}/docker-compose.yaml | 10 ++-- go/docker-compose.yaml | 8 +-- .../Dockerfile | 0 oauth/Makefile | 41 ++++++++++++++ oauth/README.md | 2 + oauth/docker-compose.yaml | 18 ++++++ os/ubuntu/Dockerfile | 3 +- .../Dockerfile | 0 .../Dockerfile | 0 redoc/docker-compose.yaml | 8 +-- squid/Dockerfile | 0 squid/docker-compose.yaml | 8 +-- {dockerfile => sshd}/Dockerfile.alpine.sshd | 0 .../Dockerfile.centos.vagrant | 0 sshd/Makefile | 41 ++++++++++++++ sshd/docker-compose.yaml | 12 ++++ .../Dockerfile.ubuntu.vim => vim/Dockerfile | 0 vim/Makefile | 41 ++++++++++++++ vim/README.md | 2 + vim/docker-compose.yaml | 18 ++++++ 38 files changed, 348 insertions(+), 255 deletions(-) rename dockerfile/Dockerfile.alpine.apkbuild => apkbuild/Dockerfile (100%) create mode 100644 apkbuild/Makefile create mode 100644 apkbuild/README.md create mode 100644 apkbuild/docker-compose.yaml rename {dockerfile => base}/Dockerfile.alpine.common (100%) rename {dockerfile => base}/Dockerfile.ubuntu.common (100%) create mode 100644 base/README.md delete mode 100644 dockerfile/Dockerfile.alpine.base delete mode 100644 dockerfile/Dockerfile.alpine.github delete mode 100644 dockerfile/Dockerfile.debian.github delete mode 100644 dockerfile/Dockerfile.debian.lint delete mode 100644 dockerfile/Dockerfile.debian.webhook delete mode 100644 dockerfile/Dockerfile.ubuntu.base delete mode 100644 dockerfile/Dockerfile.ubuntu.vue delete mode 100644 fpm/Makefile create mode 100644 fpmbuild/Dockerfile create mode 100644 fpmbuild/Makefile rename {fpm => fpmbuild}/docker-compose.yaml (57%) rename dockerfile/Dockerfile.ubuntu.oauth2 => oauth/Dockerfile (100%) create mode 100644 oauth/Makefile create mode 100644 oauth/README.md create mode 100644 oauth/docker-compose.yaml rename dockerfile/Dockerfile.alpine.redis => redis/Dockerfile (100%) rename dockerfile/Dockerfile.debian.redoc => redoc/Dockerfile (100%) create mode 100644 squid/Dockerfile rename {dockerfile => sshd}/Dockerfile.alpine.sshd (100%) rename {dockerfile => sshd}/Dockerfile.centos.vagrant (100%) create mode 100644 sshd/Makefile create mode 100644 sshd/docker-compose.yaml rename dockerfile/Dockerfile.ubuntu.vim => vim/Dockerfile (100%) create mode 100644 vim/Makefile create mode 100644 vim/README.md create mode 100644 vim/docker-compose.yaml diff --git a/dockerfile/Dockerfile.alpine.apkbuild b/apkbuild/Dockerfile similarity index 100% rename from dockerfile/Dockerfile.alpine.apkbuild rename to apkbuild/Dockerfile diff --git a/apkbuild/Makefile b/apkbuild/Makefile new file mode 100644 index 0000000..c46da97 --- /dev/null +++ b/apkbuild/Makefile @@ -0,0 +1,41 @@ +# LABEL Maintainer="airdb team " Description="https://github.com/airdb" + +SERVICE := apkbuild + +all: help + +help: ## Show help messages + @echo "Container - ${SERVICE} " + @echo + @echo "Usage:\tmake COMMAND" + @echo + @echo "Commands:" + @sed -n '/##/s/\(.*\):.*##/ \1#/p' ${MAKEFILE_LIST} | grep -v "MAKEFILE_LIST" | column -t -c 2 -s '#' + +up: ## Create and start containers + docker compose up -d --force-recreate + #docker compose up -d --build --force-recreate + +build: ## Build or rebuild services + docker compose build --no-cache + +start: ## Start services + docker compose start ${SERVICE} + +stop: ## Stop services + docker compose stop ${SERVICE} + +restart: ## Restart containers + docker compose restart ${SERVICE} + +ps: ## List containers + docker compose ps + +log logs: ## View output from containers + docker compose logs ${SERVICE} + +rm: stop ## Stop and remove stopped service containers + docker compose rm ${SERVICE} + +bash: ## Execute a command in a running container + docker compose exec ${SERVICE} bash diff --git a/apkbuild/README.md b/apkbuild/README.md new file mode 100644 index 0000000..5b9b83a --- /dev/null +++ b/apkbuild/README.md @@ -0,0 +1,8 @@ +# Alpine + +最小的 linux, 可以用来构建最小的 docker image. + + +Make customized Alpine Linux rootfs (base image) for containers + +- https://github.com/alpinelinux/alpine-make-rootfs diff --git a/apkbuild/docker-compose.yaml b/apkbuild/docker-compose.yaml new file mode 100644 index 0000000..cdcc310 --- /dev/null +++ b/apkbuild/docker-compose.yaml @@ -0,0 +1,18 @@ +version: '3' + +services: + apkbuild: + container_name: apkbuild + image: 'airdb/apkbuild:latest' + platform: linux/amd64 + working_dir: /srv/ + build: + context: . + dockerfile: Dockerfile + command: sleep 3600 + volumes: + - ./:/srv/apkbuild + ports: + - "8080:8080" + environment: + - env=test diff --git a/asp/Dockerfile b/asp/Dockerfile index 933ea09..da8bd7b 100644 --- a/asp/Dockerfile +++ b/asp/Dockerfile @@ -1,4 +1,3 @@ -# syntax=docker/dockerfile:1 FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env docker pull mcr.microsoft.com/dotnet/aspnet WORKDIR /app diff --git a/dockerfile/Dockerfile.alpine.common b/base/Dockerfile.alpine.common similarity index 100% rename from dockerfile/Dockerfile.alpine.common rename to base/Dockerfile.alpine.common diff --git a/dockerfile/Dockerfile.ubuntu.common b/base/Dockerfile.ubuntu.common similarity index 100% rename from dockerfile/Dockerfile.ubuntu.common rename to base/Dockerfile.ubuntu.common diff --git a/base/README.md b/base/README.md new file mode 100644 index 0000000..8de5269 --- /dev/null +++ b/base/README.md @@ -0,0 +1,11 @@ +Base image + + +## 安装包 +gcc g++ make + +net-tools iproute2 iputils-ping telnet nmap + +ca-certificates + +curl git less vim diff --git a/dockerfile/Dockerfile.alpine.base b/dockerfile/Dockerfile.alpine.base deleted file mode 100644 index 70fd3e4..0000000 --- a/dockerfile/Dockerfile.alpine.base +++ /dev/null @@ -1,20 +0,0 @@ -FROM scratch - -LABEL description="Alpine minirootfs lastet stable" \ - tags="latest 3.7.0" \ - maintainer="Dean " \ - build_ver="20171123143200" - -# Must download file to local. if use url to add it, it doesn't unpack. -# wget http://nl.alpinelinux.org/alpine/latest-stable/releases/x86_64/alpine-minirootfs-3.7.0-x86_64.tar.gz - -ADD alpine-minirootfs-3.7.0-x86_64.tar.gz / -ADD motd /etc/motd -ADD Shanghai /etc/localtime -ADD airdb.com.sh /etc/profile.d/ - -RUN apk add --no-cache mysql-client - -WORKDIR /srv - -CMD ["/bin/sh", "--login"] diff --git a/dockerfile/Dockerfile.alpine.github b/dockerfile/Dockerfile.alpine.github deleted file mode 100644 index b1a2906..0000000 --- a/dockerfile/Dockerfile.alpine.github +++ /dev/null @@ -1,46 +0,0 @@ -FROM alpine:3.9.4 -MAINTAINER airdb.com - -# Step 1: List service infomation and choose stable version. -ENV SERVICE ci-lint -ENV PS1 '[\H \W]\$ ' -ENV PASSWD airdb.com - -ADD https://raw.githubusercontent.com/airdb/docker/master/templates/motd /etc/motd -ADD https://raw.githubusercontent.com/airdb/docker/master/osinit/run_lint.sh /bin/ -ADD https://raw.githubusercontent.com/airdb/docker/master/osinit/authorized_keys /root/.ssh/ - -#ADD airdb.com.sh /etc/profile.d/ -ENV HOMEDIR /srv -WORKDIR $HOMEDIR - -RUN apk add --update --no-cache --virtual .build-deps \ - curl \ - git \ - vim \ - sudo \ - openssh-server \ - openssh \ - && sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config \ - && echo "AcceptEnv LC_*" >> /etc/ssh/sshd_config \ - && echo root:${PASSWD} | chpasswd \ - && /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key \ - && /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key \ - && /usr/bin/ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key \ - && /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key - - # && sed -i s@#Banner\ none@Banner\ /etc/banner@ /etc/ssh/sshd_config \ - - -ENV RUNNING_CONTEXT "docker" -RUN echo "export RUNNING_CONTEXT=docker" >> /etc/profile -RUN echo "export PS1='[\H \W]\\$ '" >> /etc/profile -RUN echo "export PATH='$PATH:$HOME/go/bin'" >> /etc/profile -RUN echo "export GO111MODULE=on" >> /etc/profile -RUN echo 'export HISTTIMEFORMAT="%Y-%m-%d %T \$LC_NAME \$SSH_TTY " ' >> /etc/profile - -ADD https://raw.githubusercontent.com/airdb/docker/master/templates/sudoers.d/vagrant /etc/sudoers.d/ -RUN chmod +x /bin/run_lint.sh - -EXPOSE 22 -CMD /bin/run_lint.sh diff --git a/dockerfile/Dockerfile.debian.github b/dockerfile/Dockerfile.debian.github deleted file mode 100644 index 28f8609..0000000 --- a/dockerfile/Dockerfile.debian.github +++ /dev/null @@ -1,56 +0,0 @@ -#FROM ubuntu:22:04 -FROM ubuntu:22:04 -MAINTAINER info@airdb.com - -# docker build -t airdb/toolbox . -f toolbox.dockerfile - -# Step 1: List service infomation and choose stable version. -ENV RUNNING_CONTEXT="docker" \ - SERVICE=toolbox \ - LANGUAGE=en_US.UTF-8 \ - PS1='[\H \W]\$ ' \ - PASSWD=airdb.com \ - LANG=en_US.UTF-8 \ - LANGUAGE=en_US.UTF-8 \ - HOMEDIR=/srv \ - PS1='[\H \W]\$ ' \ - HOSTNAME=airdb.dev \ - PASSWD=airdb.com - - -#ADD airdb.com.sh /etc/profile.d/ -WORKDIR $HOMEDIR - -RUN apt update && apt install -y curl \ - git \ - vim \ - gcc \ - mysql-client - -RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ - apt install -y nodejs && \ - npm install -g serverless - - -RUN apt-key --keyring /usr/share/keyrings/githubcli-archive-keyring.gpg adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 &&\ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/github-cli2.list > /dev/null &&\ - apt update &&\ - apt install -y gh - -ADD https://golang.org/dl/go1.16.4.linux-amd64.tar.gz /tmp/go.tar.gz -RUN tar xvf /tmp/go.tar.gz -C /srv/ && \ - /srv/go/bin/go env -w GOPRIVATE=airdb.io,github.com/airdb && \ - /srv/go/bin/go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - -RUN rm -f /tmp/go.tar.gz - -WORKDIR /root/src/airdb.io/airdb -RUN echo "export RUNNING_CONTEXT=docker" >> /etc/profile -RUN echo "export PS1='[\H \W]\\$ '" >> /etc/profile -RUN echo "export PATH='$PATH:/srv/go/bin:/go/bin/'" >> /etc/profile -RUN echo 'export HISTTIMEFORMAT="%Y-%m-%d %T $(pwd)" ' >> /etc/profile - -RUN sh /etc/profile - -#CMD /bin/bash -CMD ["/bin/bash", "--login", "--init-file", "/etc/profile"] diff --git a/dockerfile/Dockerfile.debian.lint b/dockerfile/Dockerfile.debian.lint deleted file mode 100644 index b1a2906..0000000 --- a/dockerfile/Dockerfile.debian.lint +++ /dev/null @@ -1,46 +0,0 @@ -FROM alpine:3.9.4 -MAINTAINER airdb.com - -# Step 1: List service infomation and choose stable version. -ENV SERVICE ci-lint -ENV PS1 '[\H \W]\$ ' -ENV PASSWD airdb.com - -ADD https://raw.githubusercontent.com/airdb/docker/master/templates/motd /etc/motd -ADD https://raw.githubusercontent.com/airdb/docker/master/osinit/run_lint.sh /bin/ -ADD https://raw.githubusercontent.com/airdb/docker/master/osinit/authorized_keys /root/.ssh/ - -#ADD airdb.com.sh /etc/profile.d/ -ENV HOMEDIR /srv -WORKDIR $HOMEDIR - -RUN apk add --update --no-cache --virtual .build-deps \ - curl \ - git \ - vim \ - sudo \ - openssh-server \ - openssh \ - && sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config \ - && echo "AcceptEnv LC_*" >> /etc/ssh/sshd_config \ - && echo root:${PASSWD} | chpasswd \ - && /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key \ - && /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key \ - && /usr/bin/ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key \ - && /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key - - # && sed -i s@#Banner\ none@Banner\ /etc/banner@ /etc/ssh/sshd_config \ - - -ENV RUNNING_CONTEXT "docker" -RUN echo "export RUNNING_CONTEXT=docker" >> /etc/profile -RUN echo "export PS1='[\H \W]\\$ '" >> /etc/profile -RUN echo "export PATH='$PATH:$HOME/go/bin'" >> /etc/profile -RUN echo "export GO111MODULE=on" >> /etc/profile -RUN echo 'export HISTTIMEFORMAT="%Y-%m-%d %T \$LC_NAME \$SSH_TTY " ' >> /etc/profile - -ADD https://raw.githubusercontent.com/airdb/docker/master/templates/sudoers.d/vagrant /etc/sudoers.d/ -RUN chmod +x /bin/run_lint.sh - -EXPOSE 22 -CMD /bin/run_lint.sh diff --git a/dockerfile/Dockerfile.debian.webhook b/dockerfile/Dockerfile.debian.webhook deleted file mode 100644 index 83c7fc5..0000000 --- a/dockerfile/Dockerfile.debian.webhook +++ /dev/null @@ -1,13 +0,0 @@ -FROM airdb.com/alpine-go:latest - -MAINTAINER Dean dean@airdb.com -# github webhook: github.com/adnanh/webhook - -ENV PATH="$PATH:/go/bin" -RUN go get github.com/adnanh/webhook - -RUN cd /go/src/github.com/adnanh/webhook - -ENTRYPOINT webhook -verbose -hooks ./hooks.json.example - -EXPOSE 9000 diff --git a/dockerfile/Dockerfile.ubuntu.base b/dockerfile/Dockerfile.ubuntu.base deleted file mode 100644 index 0803dd0..0000000 --- a/dockerfile/Dockerfile.ubuntu.base +++ /dev/null @@ -1,9 +0,0 @@ -#MAINTAINER https://github.com/airdb - -FROM ubuntu:22:04 - -ENV NOTVISIBLE "in users profile" -RUN echo "export VISIBLE=now" >> /etc/profile -RUN echo "export DEBIAN_FRONTEND=noninteractive" >> /etc/profile - -RUN echo "export PS1='[\H \W]\\$ '" >> /root/.profile diff --git a/dockerfile/Dockerfile.ubuntu.vue b/dockerfile/Dockerfile.ubuntu.vue deleted file mode 100644 index 3b3ca9d..0000000 --- a/dockerfile/Dockerfile.ubuntu.vue +++ /dev/null @@ -1,27 +0,0 @@ -FROM ubuntu:22:04 -#FROM ubuntu:22:04 -MAINTAINER dean - -RUN apt update && apt install -y curl openssh-server lsb-core sudo -RUN mkdir /var/run/sshd -RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config - -# SSH login fix. Otherwise user is kicked off after login -RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd - -RUN echo "vagrant ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/README -RUN echo "Defaults:vagrant !requiretty" >> /etc/sudoers.d/README -ADD https://raw.githubusercontent.com/airdb/docker/master/osinit/authorized_keys /root/.ssh/ -ADD https://raw.githubusercontent.com/airdb/docker/master/templates/vim/.vimrc /root/ - -ENV NOTVISIBLE "in users profile" -RUN echo "export VISIBLE=now" >> /etc/profile - -ENV RUNNING_CONTEXT "docker" -ENV echo "export RUNNING_CONTEXT=docker" >> /etc/profile - -RUN echo "export PS1='[\H \W]\\$ '" >> /root/.profile - -WORKDIR /srv -EXPOSE 22 -CMD ["/usr/sbin/sshd", "-D"] diff --git a/fpm/Makefile b/fpm/Makefile deleted file mode 100644 index 804eee8..0000000 --- a/fpm/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -up: - docker compose up -d --build --force-recreate -build: - docker compose build --no-cache - -start: - docker compose start - -stop: - docker compose stop - -restart: - docker compose restart - -ps: - docker compose ps - -bash: - docker compose exec toolbox bash diff --git a/fpmbuild/Dockerfile b/fpmbuild/Dockerfile new file mode 100644 index 0000000..f463e81 --- /dev/null +++ b/fpmbuild/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu + +# Usage: +# docker build -t airdb/fpm . -f fpm.dockerfile +# docker run --rm -v $(pwd):/srv airdb/fpm + +ENV DEBIAN_FRONTEND noninteractive + +MAINTAINER https://github.com/airdb + +RUN echo "export VISIBLE=now" >> /etc/profile + +ENV RUNNING_CONTEXT "docker" +ENV echo "export RUNNING_CONTEXT=docker" >> /etc/profile + +RUN echo "export PS1='[\H \W]\\$ '" >> /root/.profile + +WORKDIR /srv + +RUN apt update && apt-get install -y sudo vim libgcrypt-dev libgd-dev ruby ruby-dev rubygems-integration build-essential + +#RUN gem install --no-ri --no-rdoc fpm +RUN gem install fpm + +CMD fpm -s dir \ + -t deb \ + -a amd64 \ + -n airdb \ + -v 1.0.0 \ + -m 'Dean CN ' \ + --url 'https://www.airdb.com' \ + --description 'Hello airdb' \ + --before-install ./output/before-install.sh \ + --after-install ./output/after-install.sh \ + -C ./output/ diff --git a/fpmbuild/Makefile b/fpmbuild/Makefile new file mode 100644 index 0000000..757469b --- /dev/null +++ b/fpmbuild/Makefile @@ -0,0 +1,41 @@ +# LABEL Maintainer="airdb.team" +# Description="https://github.com/deancn" + +SERVICE := fpmbuild + +all: help + +help: ## Show help messages + @echo "Container - ${SERVICE} " + @echo + @echo "Usage:\tmake COMMAND" + @echo + @echo "Commands:" + @sed -n '/##/s/\(.*\):.*##/ \1#/p' ${MAKEFILE_LIST} | grep -v "MAKEFILE_LIST" | column -t -c 2 -s '#' + +up: ## Create and start containers + docker compose up -d --build --force-recreate + +build: ## Build or rebuild services + docker compose build --no-cache + +start: ## Start services + docker compose start + +stop: ## Stop services + docker compose stop + +restart: ## Restart containers + docker compose restart + +ps: ## List containers + docker compose ps + +log logs: ## View output from containers + docker compose logs + +rm: stop ## Stop and remove stopped service containers + docker compose rm ${SERVICE} + +bash: ## Execute a command in a running container + docker compose exec ${SERVICE} bash diff --git a/fpm/docker-compose.yaml b/fpmbuild/docker-compose.yaml similarity index 57% rename from fpm/docker-compose.yaml rename to fpmbuild/docker-compose.yaml index 9f69a60..ec7c48e 100644 --- a/fpm/docker-compose.yaml +++ b/fpmbuild/docker-compose.yaml @@ -1,16 +1,16 @@ version: '3' services: - toolbox: + fpmbuild: + container_name: fpmbuild + image: 'airdb/fpmbuild:latest' platform: linux/amd64 build: - context: ../ - dockerfile: ./dockerfile/Dockerfile.ubuntu.fpm - image: 'airdb/fpm:latest' + context: . + dockerfile: Dockerfile command: sleep 3600 volumes: - ./:/srv/toolbox #ports: - "8080:8080" environment: - env=test - container_name: fpm diff --git a/go/docker-compose.yaml b/go/docker-compose.yaml index 7f13194..b3e82a9 100644 --- a/go/docker-compose.yaml +++ b/go/docker-compose.yaml @@ -2,11 +2,12 @@ version: '3' services: golang: + container_name: golang + image: 'airdb/golang:latest' platform: linux/amd64 build: - context: ../ - dockerfile: ./dockerfile/Dockerfile.debian.golang - image: 'airdb/golang:latest' + context: . + dockerfile: Dockerfile command: sleep 3600 volumes: - ./:/srv/toolbox @@ -14,4 +15,3 @@ services: - "8080:8080" environment: - env=test - container_name: golang diff --git a/dockerfile/Dockerfile.ubuntu.oauth2 b/oauth/Dockerfile similarity index 100% rename from dockerfile/Dockerfile.ubuntu.oauth2 rename to oauth/Dockerfile diff --git a/oauth/Makefile b/oauth/Makefile new file mode 100644 index 0000000..66e854b --- /dev/null +++ b/oauth/Makefile @@ -0,0 +1,41 @@ +# LABEL Maintainer="airdb team " Description="https://github.com/airdb" + +SERVICE := alpine + +all: help + +help: ## Show help messages + @echo "Container - ${SERVICE} " + @echo + @echo "Usage:\tmake COMMAND" + @echo + @echo "Commands:" + @sed -n '/##/s/\(.*\):.*##/ \1#/p' ${MAKEFILE_LIST} | grep -v "MAKEFILE_LIST" | column -t -c 2 -s '#' + +up: ## Create and start containers + docker compose up -d --force-recreate + #docker compose up -d --build --force-recreate + +build: ## Build or rebuild services + docker compose build --no-cache + +start: ## Start services + docker compose start ${SERVICE} + +stop: ## Stop services + docker compose stop ${SERVICE} + +restart: ## Restart containers + docker compose restart ${SERVICE} + +ps: ## List containers + docker compose ps + +log logs: ## View output from containers + docker compose logs ${SERVICE} + +rm: stop ## Stop and remove stopped service containers + docker compose rm ${SERVICE} + +bash: ## Execute a command in a running container + docker compose exec ${SERVICE} bash diff --git a/oauth/README.md b/oauth/README.md new file mode 100644 index 0000000..1b5d6e0 --- /dev/null +++ b/oauth/README.md @@ -0,0 +1,2 @@ +# oauth + diff --git a/oauth/docker-compose.yaml b/oauth/docker-compose.yaml new file mode 100644 index 0000000..5261b3f --- /dev/null +++ b/oauth/docker-compose.yaml @@ -0,0 +1,18 @@ +version: '3' + +services: + alpine: + container_name: alpine + platform: linux/amd64 + working_dir: /srv/ + build: + context: . + dockerfile: Dockerfile + image: 'airdb/alpine:latest' + command: sleep 3600 + volumes: + - ./:/srv/alpine + ports: + - "8080:8080" + environment: + - env=test diff --git a/os/ubuntu/Dockerfile b/os/ubuntu/Dockerfile index 6232bdd..04f1f7b 100644 --- a/os/ubuntu/Dockerfile +++ b/os/ubuntu/Dockerfile @@ -9,4 +9,5 @@ RUN echo "export VISIBLE=now" >> /etc/profile && \ echo 'set encoding=utf-8' > ~/.vimrc && \ echo 'bind "^W" ed-delete-prev-word' > ~/.editrc -RUN echo "export PS1='[\H \W]\\$ '" >> /root/.profile +RUN echo "export PS1='[\H \W]\\$ '" >> /root/.profile && \ + echo 'export HISTTIMEFORMAT="%Y-%m-%d %T $(pwd)" ' >> /etc/profile diff --git a/dockerfile/Dockerfile.alpine.redis b/redis/Dockerfile similarity index 100% rename from dockerfile/Dockerfile.alpine.redis rename to redis/Dockerfile diff --git a/dockerfile/Dockerfile.debian.redoc b/redoc/Dockerfile similarity index 100% rename from dockerfile/Dockerfile.debian.redoc rename to redoc/Dockerfile diff --git a/redoc/docker-compose.yaml b/redoc/docker-compose.yaml index 492e3a5..2a6155b 100644 --- a/redoc/docker-compose.yaml +++ b/redoc/docker-compose.yaml @@ -2,11 +2,12 @@ version: '3' services: redoc: + container_name: redoc + image: 'airdb/redoc:latest' platform: linux/amd64 build: - context: ../ - dockerfile: ./dockerfile/Dockerfile.debian.redoc - image: 'airdb/redoc:latest' + context: . + dockerfile: Dockerfile #command: sleep 3600 volumes: - ./:/srv/toolbox @@ -14,4 +15,3 @@ services: - "8080:9090" environment: - env=test - container_name: redoc diff --git a/squid/Dockerfile b/squid/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/squid/docker-compose.yaml b/squid/docker-compose.yaml index f60f427..86c64bf 100644 --- a/squid/docker-compose.yaml +++ b/squid/docker-compose.yaml @@ -2,15 +2,15 @@ version: '3' services: squid: + container_name: squid + image: 'airdb/squid:latest' platform: linux/amd64 build: - context: ../ - dockerfile: ./dockerfile/Dockerfile.debian.squid - image: 'airdb/squid:latest' + context: . + dockerfile: Dockerfile command: sleep 3600 network_mode: host volumes: - ./:/srv/proxy environment: - env=test - container_name: squid diff --git a/dockerfile/Dockerfile.alpine.sshd b/sshd/Dockerfile.alpine.sshd similarity index 100% rename from dockerfile/Dockerfile.alpine.sshd rename to sshd/Dockerfile.alpine.sshd diff --git a/dockerfile/Dockerfile.centos.vagrant b/sshd/Dockerfile.centos.vagrant similarity index 100% rename from dockerfile/Dockerfile.centos.vagrant rename to sshd/Dockerfile.centos.vagrant diff --git a/sshd/Makefile b/sshd/Makefile new file mode 100644 index 0000000..f83ca46 --- /dev/null +++ b/sshd/Makefile @@ -0,0 +1,41 @@ +# LABEL Maintainer="airdb.team" +# Description="https://github.com/deancn" + +SERVICE := sshd + +all: help + +help: ## Show help messages + @echo "Container - ${SERVICE} " + @echo + @echo "Usage:\tmake COMMAND" + @echo + @echo "Commands:" + @sed -n '/##/s/\(.*\):.*##/ \1#/p' ${MAKEFILE_LIST} | grep -v "MAKEFILE_LIST" | column -t -c 2 -s '#' + +up: ## Create and start containers + docker compose up -d --build --force-recreate + +build: ## Build or rebuild services + docker compose build --no-cache + +start: ## Start services + docker compose start + +stop: ## Stop services + docker compose stop + +restart: ## Restart containers + docker compose restart + +ps: ## List containers + docker compose ps + +log logs: ## View output from containers + docker compose logs + +rm: stop ## Stop and remove stopped service containers + docker compose rm ${SERVICE} + +bash: ## Execute a command in a running container + docker compose exec ${SERVICE} bash diff --git a/sshd/docker-compose.yaml b/sshd/docker-compose.yaml new file mode 100644 index 0000000..f1657d6 --- /dev/null +++ b/sshd/docker-compose.yaml @@ -0,0 +1,12 @@ +version: '3.3' +services: + sshd: + container_name: sshd + image: 'airdb/sshd:latest' + build: + context: . + dockerfile: Dockerfile + command: sleep 3600 + environment: + - env=test + - TZ=Asia/Shanghai diff --git a/dockerfile/Dockerfile.ubuntu.vim b/vim/Dockerfile similarity index 100% rename from dockerfile/Dockerfile.ubuntu.vim rename to vim/Dockerfile diff --git a/vim/Makefile b/vim/Makefile new file mode 100644 index 0000000..66e854b --- /dev/null +++ b/vim/Makefile @@ -0,0 +1,41 @@ +# LABEL Maintainer="airdb team " Description="https://github.com/airdb" + +SERVICE := alpine + +all: help + +help: ## Show help messages + @echo "Container - ${SERVICE} " + @echo + @echo "Usage:\tmake COMMAND" + @echo + @echo "Commands:" + @sed -n '/##/s/\(.*\):.*##/ \1#/p' ${MAKEFILE_LIST} | grep -v "MAKEFILE_LIST" | column -t -c 2 -s '#' + +up: ## Create and start containers + docker compose up -d --force-recreate + #docker compose up -d --build --force-recreate + +build: ## Build or rebuild services + docker compose build --no-cache + +start: ## Start services + docker compose start ${SERVICE} + +stop: ## Stop services + docker compose stop ${SERVICE} + +restart: ## Restart containers + docker compose restart ${SERVICE} + +ps: ## List containers + docker compose ps + +log logs: ## View output from containers + docker compose logs ${SERVICE} + +rm: stop ## Stop and remove stopped service containers + docker compose rm ${SERVICE} + +bash: ## Execute a command in a running container + docker compose exec ${SERVICE} bash diff --git a/vim/README.md b/vim/README.md new file mode 100644 index 0000000..79e6633 --- /dev/null +++ b/vim/README.md @@ -0,0 +1,2 @@ +# vim + diff --git a/vim/docker-compose.yaml b/vim/docker-compose.yaml new file mode 100644 index 0000000..5261b3f --- /dev/null +++ b/vim/docker-compose.yaml @@ -0,0 +1,18 @@ +version: '3' + +services: + alpine: + container_name: alpine + platform: linux/amd64 + working_dir: /srv/ + build: + context: . + dockerfile: Dockerfile + image: 'airdb/alpine:latest' + command: sleep 3600 + volumes: + - ./:/srv/alpine + ports: + - "8080:8080" + environment: + - env=test