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,9 +1,9 @@ | ||||
| name: Build DNS Server Docker Image | ||||
| name: Build cunnie/sslip.io-dns-server | ||||
| 
 | ||||
| on: | ||||
|   push: | ||||
|     tags: | ||||
|       - '*'  # Trigger on any tag | ||||
|       - "*" # Trigger on any tag | ||||
|   workflow_dispatch: # Allow manual triggering | ||||
| 
 | ||||
| jobs: | ||||
| @@ -28,8 +28,7 @@ jobs: | ||||
|       - name: Build and push | ||||
|         uses: docker/build-push-action@v5 | ||||
|         with: | ||||
|           context: k8s/ | ||||
|           file: k8s/Dockerfile-sslip.io-dns-server | ||||
|           context: Docker/sslip.io-dns-server | ||||
|           platforms: linux/amd64,linux/arm64 | ||||
|           push: true | ||||
|           tags: | | ||||
							
								
								
									
										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