Skip to content

Instantly share code, notes, and snippets.

@nalgeon
Last active August 25, 2023 02:52
Show Gist options
  • Save nalgeon/b856a1cdcbc315a2f8f5c941f933d315 to your computer and use it in GitHub Desktop.
Save nalgeon/b856a1cdcbc315a2f8f5c941f933d315 to your computer and use it in GitHub Desktop.
Trying Odin
# build stage
FROM alpine:3.16 as builder
RUN apk add --no-cache clang llvm-dev g++ wget unzip bash linux-headers libc6-compat git
RUN git clone https://github.com/odin-lang/odin
WORKDIR /odin
RUN git checkout dev-2023-08
RUN bash build_odin.sh debug
# actual image
FROM alpine:3.16
RUN apk add clang g++
RUN mkdir /odin
COPY --from=builder /odin/vendor /odin/vendor
COPY --from=builder /odin/shared /odin/shared
COPY --from=builder /odin/odin /odin/odin
COPY --from=builder /odin/examples /odin/examples
COPY --from=builder /odin/core /odin/core
ENV PATH $PATH:/odin
package main
import "core:fmt"
main :: proc() {
fmt.println("Hellope!")
// Hellope!
}
image:
docker build --tag odin:latest .
run:
@docker run --rm --volume $(shell pwd):/sandbox --workdir /sandbox odin:latest odin run .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment