generated from jim60105/Containerfile-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvscode.Containerfile
54 lines (42 loc) · 1.69 KB
/
vscode.Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# syntax=docker/dockerfile:1
ARG UID=1000
ARG VERSION=EDGE
ARG RELEASE=0
ARG BASE_VERSION=quay.io/jim60105/toolbx:latest
########################################
# Base stage
########################################
FROM ${BASE_VERSION} AS base
########################################
# Final stage
########################################
FROM base AS final
ARG UID
# Make sure the cache is refreshed
ARG RELEASE
# RUN mount cache for multi-arch: https://github.com/docker/buildx/issues/549#issuecomment-1788297892
ARG TARGETARCH
ARG TARGETVARIANT
# Install vscode repository
RUN --mount=type=cache,id=dnf-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/var/cache/dnf \
rpm --import https://packages.microsoft.com/keys/microsoft.asc && \
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | tee /etc/yum.repos.d/vscode.repo > /dev/null
# Install VSCode
RUN --mount=type=cache,id=dnf-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/var/cache/dnf \
dnf -y install code
# Install VSCode Insiders
RUN --mount=type=cache,id=dnf-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/var/cache/dnf \
dnf -y install code-insiders
# Icons from https://github.com/dhanishgajjar/vscode-icons
COPY --chown=$UID:0 --chmod=775 vscode/icons /usr/share/icons
# Copy desktop files
COPY --chown=$UID:0 --chmod=775 vscode/desktop /usr/share/applications
# Copy toolbox runner
COPY --chown=$UID:0 --chmod=775 vscode/runner /copy-to-host
# Set git editor
ENV GIT_EDITOR="code --wait"
ARG VERSION
ARG RELEASE
LABEL version=${VERSION} \
release=${RELEASE} \
io.k8s.display-name="toolbx-vscode"