microsoft/typespec

Public

mirrored fromhttps://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
d8ea328e72d19b863da1fd4d499ec2ff6e5b737c

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docker/Dockerfile

33lines · modecode

1# --------------------------------
2# Build compiler
3# --------------------------------
4# cspell:ignore tdnf
5# mcr doesn't provide any update to date images for nodejs... so we use the devcontainers image for building.
6# FROM mcr.microsoft.com/azurelinux/base/nodejs:20.14 AS builder
7FROM mcr.microsoft.com/devcontainers/javascript-node:22 AS builder
8COPY . /app
9
10# Upgrade all packages per https://eng.ms/docs/more/containers-secure-supply-chain/updating.
11# RUN tdnf update -y \
12# && tdnf install -y \
13# git \
14# && tdnf clean all
15
16WORKDIR /app
17RUN npm install -g pnpm
18RUN pnpm install --filter "@typespec/compiler..."
19RUN pnpm --filter "@typespec/compiler..." run build
20
21WORKDIR /app/packages/compiler
22RUN npm pack
23
24# --------------------------------
25# Setup final image
26# --------------------------------
27FROM mcr.microsoft.com/azurelinux/base/nodejs:20.14
28
29COPY --from=builder /app/packages/compiler/*.tgz /tmp/compiler.tgz
30
31RUN npm install -g /tmp/compiler.tgz && rm /tmp/compiler.tgz
32
33ENTRYPOINT [ "tsp" ]