From cda6adff6952e5789228d71b361e4082eae73e2f Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Halili Date: Sat, 12 Oct 2024 14:12:32 +0000 Subject: [PATCH] chore(global): commit everything before the scheduled trial VM shutdown This includes a quick downgrade to jammy first for devenv/base while waiting for update at gitpod-io/workspace-images. Signed-off-by: Andrei Jiroh Halili --- caddy/.gitkeep | 0 docker/devenv/base/Dockerfile | 43 +++++++++++++++++-- .../devenv/base/sources.list.d/docker.sources | 5 +++ docker/devenv/base/sources.list.d/git.sources | 4 +- docker/pkgops-alpine/Dockerfile | 3 +- homelab/docker-compose.yml | 36 +++++++++++++++- scripts/build | 2 +- 7 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 caddy/.gitkeep create mode 100644 docker/devenv/base/sources.list.d/docker.sources diff --git a/caddy/.gitkeep b/caddy/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker/devenv/base/Dockerfile b/docker/devenv/base/Dockerfile index 4e7cca5..9d47fcd 100644 --- a/docker/devenv/base/Dockerfile +++ b/docker/devenv/base/Dockerfile @@ -1,6 +1,5 @@ -ARG BUILDPACK_DEPS_TAG=noble -ARG GITLAB_DEPENDENCY_PROXY_PATH=mau.dev/andreijiroh-dev -FROM ${GITLAB_DEPENDENCY_PROXY_PATH}/dependency_proxy/containers/buildpack-deps:${BUILDPACK_DEPS_TAG} +ARG BUILDPACK_DEPS_TAG=jammy +FROM buildpack-deps:${BUILDPACK_DEPS_TAG} USER root @@ -9,7 +8,8 @@ RUN curl -o /usr/local/bin/install-packages -fsSL https://github.com/gitpod-io/w && chmod +x /usr/local/bin/install-packages \ && ln -s /usr/local/bin/install-packages /usr/local/bin/upgrade-packages -RUN install-packages \ +RUN yes | unminimize \ + && install-packages \ zip \ unzip \ bash-completion \ @@ -51,8 +51,25 @@ RUN curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf911ab18 && curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.gpg > /tmp/key.gpg \ && gpg --dearmor - < /tmp/key.gpg > /usr/share/keyrings/tailscale-archive-keyring.gpg \ && curl -fsLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key'| gpg --dearmor -o /usr/share/keyrings/caddy-xcaddy-archive-keyring.gpg \ + && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \ && rm /tmp/key.gpg +# https://docs.docker.com/engine/install/ubuntu/ +RUN \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \ + && apt update \ + && install-packages docker-ce=5:24.0.9-1~ubuntu.22.04~jammy docker-ce-cli=5:24.0.9-1~ubuntu.22.04~jammy containerd.io docker-buildx-plugin + +RUN curl -o /usr/local/bin/docker-compose -fsSL https://github.com/docker/compose/releases/download/v2.24.1/docker-compose-linux-$(uname -m) \ + && chmod +x /usr/local/bin/docker-compose && mkdir -p /usr/local/lib/docker/cli-plugins && \ + ln -s /usr/local/bin/docker-compose /usr/local/lib/docker/cli-plugins/docker-compose + +# https://github.com/wagoodman/dive +RUN curl -o /tmp/dive.deb -fsSL https://github.com/wagoodman/dive/releases/download/v0.11.0/dive_0.11.0_linux_amd64.deb \ + && apt install /tmp/dive.deb \ + && rm /tmp/dive.deb + RUN install-packages git git-lfs git-email \ && git lfs install --system --skip-repo @@ -68,3 +85,21 @@ RUN userdel ubuntu -f -r && \ USER gitpod WORKDIR /home/gitpod + +RUN sudo echo hello world >> /dev/null \ + && mkdir -p /home/gitpod/.bashrc.d && \ + (echo; echo "for i in \$(ls -A \$HOME/.bashrc.d/); do source \$HOME/.bashrc.d/\$i; done"; echo) >> /home/gitpod/.bashrc \ + && mkdir -p /home/gitpod/.local/share/bash-completion/completions + +ARG NODE_VERSION=v20.17.0 # TODO: Automate this on GitHub Actions +ENV NODE_VERSION=${NODE_VERSION} PNPM_HOME=/home/gitpod/.pnpm +ENV PATH=$HOME/.local/bin:/usr/games:/home/gitpod/.nvm/versions/node/v${NODE_VERSION}/bin:/home/gitpod/.yarn/bin:${PNPM_HOME}:$PATH + +## Node.js +RUN curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | PROFILE=/dev/null bash \ + && bash -c ". .nvm/nvm.sh \ + && nvm install v${NODE_VERSION} \ + && nvm alias default v${NODE_VERSION} \ + && npm install -g typescript yarn pnpm node-gyp" \ + && echo ". ~/.nvm/nvm-lazy.sh" >> /home/gitpod/.bashrc.d/50-node \ + && wget https://github.com/gitpod-io/workspace-images/raw/main/chunks/lang-node/nvm-lazy.sh -O ~/.nvm/nvm-lazy.sh diff --git a/docker/devenv/base/sources.list.d/docker.sources b/docker/devenv/base/sources.list.d/docker.sources new file mode 100644 index 0000000..8613e58 --- /dev/null +++ b/docker/devenv/base/sources.list.d/docker.sources @@ -0,0 +1,5 @@ +Types: deb +URIs: https://download.docker.com/linux/ubuntu +Suites: jammy +Components: stable +Signed-By: /usr/share/keyrings/docker-archive-keyring.gpg \ No newline at end of file diff --git a/docker/devenv/base/sources.list.d/git.sources b/docker/devenv/base/sources.list.d/git.sources index c3a7e22..c49fde1 100644 --- a/docker/devenv/base/sources.list.d/git.sources +++ b/docker/devenv/base/sources.list.d/git.sources @@ -1,11 +1,11 @@ Types: deb URIs: https://ppa.launchpadcontent.net/git-core/ppa/ubuntu -Suites: noble +Suites: jammy Components: main Signed-By: /usr/share/keyrings/git-ppa-archive-keyring.gpg Types: deb URIs: https://packagecloud.io/github/git-lfs/ubuntu -Suites: noble +Suites: jammy Components: main Signed-By: /usr/share/keyrings/github_git-lfs.gpg \ No newline at end of file diff --git a/docker/pkgops-alpine/Dockerfile b/docker/pkgops-alpine/Dockerfile index c31e763..c38af8d 100644 --- a/docker/pkgops-alpine/Dockerfile +++ b/docker/pkgops-alpine/Dockerfile @@ -1,7 +1,6 @@ # syntax=docker/dockerfile:1.3 ARG ALPINE_RELEASE=edge -ARG GITLAB_DEPENDENCY_PROXY_PATH=mau.dev/andreijiroh-dev -FROM ${GITLAB_DEPENDENCY_PROXY_PATH}/containers/dependency_proxy/alpine:${ALPINE_RELEASE} +FROM alpine:${ALPINE_RELEASE} LABEL org.opencontainers.image.description="Custom CI image for Alpine Linux package devs and maintainers" \ org.opencontainers.image.source="https://github.com/andreijiroh-dev/docker-images" \ diff --git a/homelab/docker-compose.yml b/homelab/docker-compose.yml index 7249499..fa85fc9 100644 --- a/homelab/docker-compose.yml +++ b/homelab/docker-compose.yml @@ -1,2 +1,36 @@ -version: "2" +services: + mediawiki-caddy: + build: + context: ./mediawiki + dockerfile: Dockerfile + # uncomment the following line if you want to run this in a production environment + restart: always + ports: + - "4208:80" # HTTP + volumes: + - ./config/mw/LocalSettings.php:/app/public/LocalSettings.php + - caddy_data:/data + - caddy_config:/config + cap_add: + - + # comment the following line in production, it allows to have nice human-readable logs in dev + #tty: true + db-backend: + image: mariadb + restart: always + ports: + - 3306:3306 + environment: + # @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php + MYSQL_DATABASE: mediawiki-localdev + MYSQL_USER: wikiuser + MYSQL_PASSWORD: + MYSQL_RANDOM_ROOT_PASSWORD: 'yes' + volumes: + - db:/var/lib/mysql +# Volumes needed for Caddy certificates and configuration +volumes: + caddy_data: + caddy_config: + db: \ No newline at end of file diff --git a/scripts/build b/scripts/build index 8557d9e..383a336 100755 --- a/scripts/build +++ b/scripts/build @@ -40,4 +40,4 @@ main() { "${GIT_ROOT}/${BUILD_DIR}" } -main $* \ No newline at end of file +main "$@" \ No newline at end of file -- 2.51.2