FROM node:24
RUN npm install -g @github/copilot
USER node
WORKDIR /home/nodedocker buildx build -t docker-copilot-setup .docker run --name setup -it docker-copilot-setup bashOpen the URL: https://github.com/settings/personal-access-tokens/new or transfer pages as follows:
- Settings > Developer settings > Personal access tokens > Fine-grained tokens
Create a personal access token with permissions: Copilot Requests
node@containerid:/~$ export GITHUB_TOKEN=(personal access token)
node@containerid:/~$ copilot
Confirm folder trust
/home/node
(Choose: 2. Yes, and remember this folder for future sessions)
> /login
What account do you want to log into?
(Choose: 1. GitHub.com)
(Open the URL: https://github.com/login/device)
(Authorize github by entering one-time code)
Press any key to copy to clipboard and open browser...
(Press any key, then a message suggesting a login failure appears briefly, but login succeeds after a while.)
Would you like to store the token in the plain text config file instead?
(Choose: 1. Yes, I accept that risk.)
(Exit copilot, but don't exit docker)On a different terminal, create a Docker image from the current container's state.
docker commit setup docker-copilot:latestAfter exiting the Docker container, delete the container used for setup.
docker rm setupFROM docker-copilot
USER root
RUN apt-get update -yq && apt-get install -yq curl build-essential
USER node
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/home/node/.cargo/bin:$PATH"
RUN cargo install cargo-llvm-cov && \
cargo install cargo-msrv --locked
WORKDIR /home/node/workspacedocker buildx build -f Dockerfile_rust -t docker-copilot-rust .docker run --name copilot-rust -v ./:/home/node/workspace -it docker-copilot-rust bashFROM docker-copilot
USER root
RUN apt-get update -yq && apt-get install -yq curl build-essential
RUN curl -OL https://go.dev/dl/go1.25.1.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.25.1.linux-amd64.tar.gz
USER node
ENV PATH="/usr/local/go/bin:$PATH"
WORKDIR /home/node/workspacedocker buildx build -f Dockerfile_go -t docker-copilot-go .docker run --name copilot-go -v ./:/home/node/workspace -it docker-copilot-go bashFROM docker-copilot
USER root
RUN apt-get update -yq && apt-get install -yq curl build-essential
USER node
WORKDIR /home/node
RUN curl -OL https://download.oracle.com/graalvm/25/latest/graalvm-jdk-25_linux-x64_bin.tar.gz && \
tar -xzf graalvm-jdk-25_linux-x64_bin.tar.gz
ENV PATH=/home/node/graalvm-jdk-25+37.1/bin:$PATH
WORKDIR /home/node/workspacedocker buildx build -f Dockerfile_java -t docker-copilot-java .docker run --name copilot-java -v ./:/home/node/workspace -it docker-copilot-java bash