mirror of
				https://github.com/cunnie/sslip.io.git
				synced 2025-10-31 19:02:50 +08:00 
			
		
		
		
	Organize Dockerfiles
We produce 3 Docker images - sslip.io-dns-server (run sslip.io in a container) - fedora-golang-bosh (CI testing) - fedora-ruby-bind-utils (nameserver testing) We place the Dockerfiles under `Docker/` with a subdirectory name corresponding to the Docker image name. TODO: we need to tidy the Dockerfiles under `k8s`, but we'll leave that for another day.
This commit is contained in:
		
							
								
								
									
										36
									
								
								.github/workflows/docker-fedora-golang-bosh.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								.github/workflows/docker-fedora-golang-bosh.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | |||||||
|  | name: Build cunnie/fedora-golang-bosh | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     paths: | ||||||
|  |       - "Docker/fedora-golang-bosh/Dockerfile" | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |   workflow_dispatch: | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   build: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout code | ||||||
|  |         uses: actions/checkout@v4 | ||||||
|  |  | ||||||
|  |       - name: Set up QEMU | ||||||
|  |         uses: docker/setup-qemu-action@v3 | ||||||
|  |  | ||||||
|  |       - name: Set up Docker Buildx | ||||||
|  |         uses: docker/setup-buildx-action@v3 | ||||||
|  |  | ||||||
|  |       - name: Login to Docker Hub | ||||||
|  |         uses: docker/login-action@v3 | ||||||
|  |         with: | ||||||
|  |           username: cunnie | ||||||
|  |           password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||||
|  |  | ||||||
|  |       - name: Build and push | ||||||
|  |         uses: docker/build-push-action@v5 | ||||||
|  |         with: | ||||||
|  |           context: Docker/fedora-golang-bosh | ||||||
|  |           platforms: linux/amd64,linux/arm64 | ||||||
|  |           push: true | ||||||
|  |           tags: cunnie/fedora-golang-bosh:latest | ||||||
							
								
								
									
										40
									
								
								.github/workflows/docker-fedora-ruby-bind-utils.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								.github/workflows/docker-fedora-ruby-bind-utils.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | |||||||
|  | name: Build cunnie/fedora- | ||||||
|  |   ruby-bind-utils | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     paths: | ||||||
|  |       - "Docker/fedora- | ||||||
|  |         ruby-bind-utils/Dockerfile" | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |   workflow_dispatch: | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   build: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout code | ||||||
|  |         uses: actions/checkout@v4 | ||||||
|  |  | ||||||
|  |       - name: Set up QEMU | ||||||
|  |         uses: docker/setup-qemu-action@v3 | ||||||
|  |  | ||||||
|  |       - name: Set up Docker Buildx | ||||||
|  |         uses: docker/setup-buildx-action@v3 | ||||||
|  |  | ||||||
|  |       - name: Login to Docker Hub | ||||||
|  |         uses: docker/login-action@v3 | ||||||
|  |         with: | ||||||
|  |           username: cunnie | ||||||
|  |           password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||||
|  |  | ||||||
|  |       - name: Build and push | ||||||
|  |         uses: docker/build-push-action@v5 | ||||||
|  |         with: | ||||||
|  |           context: Docker/fedora- | ||||||
|  |             ruby-bind-utils | ||||||
|  |           platforms: linux/amd64,linux/arm64 | ||||||
|  |           push: true | ||||||
|  |           tags: cunnie/fedora- | ||||||
|  |             ruby-bind-utils:latest | ||||||
| @@ -1,10 +1,10 @@ | |||||||
| name: Build DNS Server Docker Image | name: Build cunnie/sslip.io-dns-server | ||||||
| 
 | 
 | ||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     tags: |     tags: | ||||||
|       - '*'  # Trigger on any tag |       - "*" # Trigger on any tag | ||||||
|   workflow_dispatch:  # Allow manual triggering |   workflow_dispatch: # Allow manual triggering | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   build-and-push: |   build-and-push: | ||||||
| @@ -28,10 +28,9 @@ jobs: | |||||||
|       - name: Build and push |       - name: Build and push | ||||||
|         uses: docker/build-push-action@v5 |         uses: docker/build-push-action@v5 | ||||||
|         with: |         with: | ||||||
|           context: k8s/ |           context: Docker/sslip.io-dns-server | ||||||
|           file: k8s/Dockerfile-sslip.io-dns-server |  | ||||||
|           platforms: linux/amd64,linux/arm64 |           platforms: linux/amd64,linux/arm64 | ||||||
|           push: true |           push: true | ||||||
|           tags: | |           tags: | | ||||||
|             cunnie/sslip.io-dns-server:latest |             cunnie/sslip.io-dns-server:latest | ||||||
|             cunnie/sslip.io-dns-server:${{ github.ref_name }}  |             cunnie/sslip.io-dns-server:${{ github.ref_name }} | ||||||
							
								
								
									
										86
									
								
								Docker/fedora-golang-bosh/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								Docker/fedora-golang-bosh/Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,86 @@ | |||||||
|  | # cunnie/fedora-golang-bosh | ||||||
|  |  | ||||||
|  | # To build | ||||||
|  |  | ||||||
|  | # docker buildx build --pull --platform=linux/amd64,linux/arm64 -t cunnie/fedora-golang-bosh . # OR | ||||||
|  | # docker build -t cunnie/fedora-golang-bosh . | ||||||
|  | # docker push cunnie/fedora-golang-bosh | ||||||
|  |  | ||||||
|  | FROM fedora | ||||||
|  |  | ||||||
|  | LABEL org.opencontainers.image.authors="Brian Cunnie <brian.cunnie@gmail.com>" | ||||||
|  |  | ||||||
|  | # need ruby to run dns-check.rb & bind-utils for dig & nslookup | ||||||
|  | RUN dnf update -y; \ | ||||||
|  |   dnf groupinstall -y "Development Tools"; \ | ||||||
|  |   dnf install -y \ | ||||||
|  |     bind-utils \ | ||||||
|  |     binutils \ | ||||||
|  |     btrfs-progs \ | ||||||
|  |     direnv \ | ||||||
|  |     etcd \ | ||||||
|  |     fd-find \ | ||||||
|  |     gcc-g++ \ | ||||||
|  |     git \ | ||||||
|  |     golang \ | ||||||
|  |     htop \ | ||||||
|  |     iproute \ | ||||||
|  |     iputils \ | ||||||
|  |     jq \ | ||||||
|  |     mysql-devel \ | ||||||
|  |     neovim \ | ||||||
|  |     net-tools \ | ||||||
|  |     nmap-ncat \ | ||||||
|  |     npm \ | ||||||
|  |     openssl-devel \ | ||||||
|  |     python \ | ||||||
|  |     redhat-rpm-config \ | ||||||
|  |     ripgrep \ | ||||||
|  |     ruby \ | ||||||
|  |     ruby-devel \ | ||||||
|  |     rubygems \ | ||||||
|  |     socat \ | ||||||
|  |     strace \ | ||||||
|  |     tcpdump \ | ||||||
|  |     tmux \ | ||||||
|  |     wget \ | ||||||
|  |     zlib-devel \ | ||||||
|  |     zsh \ | ||||||
|  |     zsh-lovers \ | ||||||
|  |     zsh-syntax-highlighting \ | ||||||
|  |     ; | ||||||
|  |  | ||||||
|  | RUN mkdir ~/workspace; \ | ||||||
|  |   cd ~/workspace; \ | ||||||
|  |   git clone https://github.com/clvv/fasd.git; \ | ||||||
|  |   cd fasd; \ | ||||||
|  |   sudo make install; \ | ||||||
|  |   echo 'eval "\$(fasd --init posix-alias zsh-hook)"' >> ~/.zshrc; \ | ||||||
|  |   echo 'alias z='fasd_cd -d'     # cd, same functionality as j in autojump' >> ~/.zshrc \ | ||||||
|  | EOF | ||||||
|  |  | ||||||
|  | RUN  echo "" | SHELL=/usr/bin/zsh /usr/bin/zsh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \ | ||||||
|  |     sed -i 's/robbyrussell/agnoster/' ~/.zshrc; \ | ||||||
|  |     echo 'export EDITOR=nvim' >> ~/.zshrc; \ | ||||||
|  |     echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.zshrc | ||||||
|  |  | ||||||
|  | # amd64, arm64 (so I can run on AWS graviton2, natively on M1, M2 macs) | ||||||
|  | ARG TARGETARCH | ||||||
|  |  | ||||||
|  | RUN curl -L https://github.com/cloudfoundry/bosh-cli/releases/download/v7.5.2/bosh-cli-7.5.2-linux-${TARGETARCH} -o /usr/local/bin/bosh; \ | ||||||
|  |   chmod +x /usr/local/bin/bosh | ||||||
|  |  | ||||||
|  | RUN dnf install -y dnf-plugins-core; \ | ||||||
|  |   dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo; \ | ||||||
|  |   dnf -y install vault; \ | ||||||
|  |   setcap -r /usr/bin/vault | ||||||
|  |  | ||||||
|  | # https://packages.cloudfoundry.org/stable?release=redhat64&version=8.7.8&source=github-rel | ||||||
|  | # https://packages.cloudfoundry.org/stable?release=redhataarch64&version=8.7.8&source=github-rel | ||||||
|  | RUN ARCH=${TARGETARCH/amd64/64}; ARCH=${ARCH/arm64/aarch64} ; \ | ||||||
|  |   curl -L "https://packages.cloudfoundry.org/stable?release=redhat${ARCH}&version=8.7.8&source=github-rel" -o cli.rpm; \ | ||||||
|  |   rpm -i cli.rpm | ||||||
|  |  | ||||||
|  | RUN CGO_ENABLED=0 GOBIN=/usr/local/bin go install github.com/onsi/ginkgo/v2/ginkgo@latest | ||||||
|  |  | ||||||
|  | CMD [ "/usr/bin/zsh" ] | ||||||
		Reference in New Issue
	
	Block a user
	 Brian Cunnie
					Brian Cunnie