Skip to content

Instantly share code, notes, and snippets.

@Tiffceet
Last active July 3, 2025 02:41
Show Gist options
  • Select an option

  • Save Tiffceet/47a059c56d695fe182b0a55167e3edcd to your computer and use it in GitHub Desktop.

Select an option

Save Tiffceet/47a059c56d695fe182b0a55167e3edcd to your computer and use it in GitHub Desktop.
GCP ubuntu22 cloud oss
FROM ubuntu:22.04
RUN yes | unminimize
# Install essentials
RUN apt update
RUN apt install -y openssh-client openssh-server ca-certificates curl sudo vim
# Install docker
RUN install -m 0755 -d /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
RUN chmod a+r /etc/apt/keyrings/docker.asc
RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update
RUN apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Copy Code OSS for Cloud Workstation binary from base image
COPY --from=us-central1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss /opt/code-oss /opt/code-oss
# Copy google's Code OSS container scripts
COPY --from=us-central1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss /google/scripts /google/scripts
COPY --from=us-central1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss /usr/bin/workstation-startup /usr/bin/workstation-startup
COPY --from=us-central1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss /etc/workstation-startup.d /etc/workstation-startup.d
COPY --from=us-central1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss /etc/profile.d /etc/profile.d
# Disable public key authentication to allow direct ssh with no password (replicated sshd_config from us-central1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss)
RUN echo "PubkeyAuthentication no" >> /etc/ssh/sshd_config
RUN echo "PrintLastLog no" >> /etc/ssh/sshd_config
RUN echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
ENTRYPOINT ["bash", "/google/scripts/entrypoint.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment