FROM archlinux:latest AS release ARG OPENCODE_VERSION COPY mirrorlist /etc/pacman.d/mirrolist RUN pacman-key --init #RUN pacman-key --refresh-keys ADD https://gitea.woggioni.net/api/packages/woggioni/arch/repository.key ./repository.key RUN pacman-key --add repository.key RUN pacman-key --lsign-key 0D28BF66FDB45D18D8EBEE5D4C91DADCD00B3F77 RUN --mount=type=bind,source=pacman-gitea-repository.conf,target=pacman-gitea-repository.conf cat pacman-gitea-repository.conf >> /etc/pacman.conf RUN echo PATH DEFAULT=${HOME}/.local/bin:/usr/local/bin:/bin >> /etc/security/pam_env.conf RUN rm repository.key RUN --mount=type=cache,target=/var/cache/pacman pacman -Syu --noconfirm RUN --mount=type=cache,target=/var/cache/pacman pacman -S --noconfirm --needed \ rustup rust-analyzer jdtls python-pipx ripgrep git rustup gradle curl sccache openssh \ helix bash-language-server marksman python-lsp-server vscode-css-languageserver \ vscode-html-languageserver vscode-json-languageserver yaml-language-server base-devel RUN --mount=type=cache,target=/var/cache/pacman pacman -S --noconfirm --needed jdk25-graalvm-ce-bin RUN useradd -m -d /var/lib/opencode opencode RUN mkdir /workspace RUN chown opencode:opencode /workspace USER opencode RUN pipx install pyright USER root ADD https://github.com/anomalyco/opencode/releases/download/v${OPENCODE_VERSION}/opencode-linux-x64.tar.gz ./opencode.tgz RUN tar -xvf ./opencode.tgz -C /usr/bin RUN rm opencode.tgz ADD --chown=opencode:opencode ./opencode.json /etc/opencode/opencode.json RUN mkdir -p /usr/lib/opencode/addons ADD --chmod=644 https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.44/lombok-1.18.44.jar /usr/lib/opencode/addons/lombok.jar ENV OPENCODE_CONFIG=/etc/opencode/opencode.json ENV EDITOR=helix USER opencode WORKDIR /workspace ENTRYPOINT ["opencode"] VOLUME ["/var/lib/opencode", "/workspace"]