Files
vscode-go/Dockerfile
2026-01-05 12:21:39 +00:00

24 lines
652 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 1. Aşama: Resmi Golang imajından Go dosyalarını çalıyoruz (En temiz yöntem)
FROM golang:1.23 AS go-source
# 2. Aşama: Code-Server üzerine inşa ediyoruz
FROM codercom/code-server:latest
USER root
# Gerekli kütüphaneleri kur (CGO ve derleme için şart)
RUN apt-get update && apt-get install -y \
build-essential \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Go'yu 1. aşamadan kopyala
COPY --from=go-source /usr/local/go /usr/local/go
# PATH ayarlarını yap (Hem root hem coder kullanıcısı için)
ENV PATH=$PATH:/usr/local/go/bin:/home/coder/go/bin
ENV GOPATH=/home/coder/go
# Kullanıcıya geri dön
USER coder