Skip to content

Instantly share code, notes, and snippets.

@nickboldt
Forked from svor/Dockerfile
Last active February 8, 2020 23:06
Show Gist options
  • Save nickboldt/93b7fd3f5490d0b3467acbe0bcd70633 to your computer and use it in GitHub Desktop.
Save nickboldt/93b7fd3f5490d0b3467acbe0bcd70633 to your computer and use it in GitHub Desktop.
# Copyright (c) 2018-2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/rhel8/dotnet-31
FROM rhel8/dotnet-31:3.1
ENV SUMMARY="Red Hat CodeReady Workspaces - Dotnet Stack container" \
DESCRIPTION="Red Hat CodeReady Workspaces - Dotnet Stack container" \
PRODNAME="codeready-workspaces" \
COMPNAME="stacks-dotnet-rhel8"
LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="$DESCRIPTION" \
io.openshift.tags="$PRODNAME,$COMPNAME" \
com.redhat.component="$PRODNAME-$COMPNAME-container" \
name="$PRODNAME/$COMPNAME" \
version="2.1" \
license="EPLv2" \
maintainer="Nick Boldt <nboldt@redhat.com>" \
io.openshift.expose-services="" \
usage=""
ENV PATH="/usr/bin:/usr/sbin${PATH:+:${PATH}}" \
MANPATH="/usr/share/man:${MANPATH:-}" \
CPATH="/usr/include${CPATH:+:${CPATH}}" \
LD_LIBRARY_PATH="/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" \
PKG_CONFIG_PATH="/usr/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" \
XDG_DATA_DIRS=/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share} \
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
# TODO is this version correct, and where do we use it?
OMNISHARP_LS_VERSION=1.34.11 \
HOME=/home/jboss \
# TODO do we still need this folder if we don't need the lang server deps tarball below?
LS_DIR=${HOME}/che/ls-csharp \
DOTNET_SDK_PATH=/usr/lib64/dotnet/sdk/ \
DOTNET_VERSION="" \
MSBuildSDKsPath=${DOTNET_SDK_PATH}/*/Sdks
USER root
# NOTE: uncomment for local build. Must also set full registry path in FROM to registry.redhat.io
# COPY content_sets*repo /etc/yum.repos.d/
# get mono RPM(s) which aren't in RHEL8 repos
# manually download from https://download.mono-project.com/repo/centos8-stable/m/mono-core/
# sudo rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
# sudo curl https://download.mono-project.com/repo/centos8-stable.repo -o /etc/yum.repos.d/mono-centos8-stable.repo
# sudo dnf install -y mono-devel mono-core mono-data mono-data-oracle mono-extras mono-web mono-winforms mono-winfxcore --downloadonly --downloaddir=./rpms --nogpgcheck --repofrompath mono-centos8-stable-nogpg,https://download.mono-project.com/repo/centos8-stable/
COPY rpms/*epel8*.rpm /tmp
# note that java and nodejs are no longer being installed here, as they were in CRW 1.2 and 2.0. python3 is still required.
RUN yum install -y --setopt=tsflags=nodocs wget curl atomic-openshift-clients python3 libgdiplus-devel pcre-devel pcre2-devel glib2-devel && \
yum update -y dotnet-host dotnet-host-fxr dotnet-runtime dotnet-sdk pango libnghttp2 && \
useradd -u 1000 -G wheel,root -d ${HOME} --shell /bin/bash -m jboss && \
mkdir -p ${HOME}/che/ls-csharp /projects && \
for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
chgrp -R 0 ${f} && \
chmod -R g+rwX ${f}; \
done && \
cat /etc/passwd | \
sed s#jboss:x.*#jboss:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/bash#g \
> ${HOME}/passwd.template && \
cat /etc/group | \
sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g \
> ${HOME}/group.template && \
echo "jboss ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Install 16 Packages
# libmono-llvm0 x86_646.8.0.105-0.xamarin.3.epel8 @commandline 9.8 M
# mono-core x86_646.8.0.105-0.xamarin.3.epel8 @commandline 46 M
# mono-data x86_646.8.0.105-0.xamarin.3.epel8 @commandline 4.4 M
# mono-data-oracle x86_646.8.0.105-0.xamarin.3.epel8 @commandline 84 k
# mono-data-sqlite x86_646.8.0.105-0.xamarin.3.epel8 @commandline 71 k
# mono-devel x86_646.8.0.105-0.xamarin.3.epel8 @commandline 34 M
# mono-extras x86_646.8.0.105-0.xamarin.3.epel8 @commandline 403 k
# mono-llvm-tools x86_646.0+mono20190708165219-0.xamarin.1.epel8 @commandline 18 M
# mono-mvc x86_646.8.0.105-0.xamarin.3.epel8 @commandline 437 k
# mono-wcf x86_646.8.0.105-0.xamarin.3.epel8 @commandline 977 k
# mono-web x86_646.8.0.105-0.xamarin.3.epel8 @commandline 2.2 M
# mono-winforms x86_646.8.0.105-0.xamarin.3.epel8 @commandline 1.5 M
# mono-winfxcore x86_646.8.0.105-0.xamarin.3.epel8 @commandline 267 k
# msbuild noarch1:16.5+xamarinxplat.2020.01.10.05.36-0.xamarin.2.epel8 @commandline 10 M
# msbuild-libhostfxr x86_643.0.0.2019.04.16.02.13-0.xamarin.4.epel8 @commandline 158 k
# msbuild-sdkresolver noarch1:16.5+xamarinxplat.2020.01.10.05.36-0.xamarin.2.epel8 @commandline 56 k
RUN yum install -y /tmp/*.rpm && \
yum clean all && rm -rf /var/cache/yum /tmp/*.rpm && \
echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" && \
echo "DOTNET_SDK_PATH = ${DOTNET_SDK_PATH}" && \
# TODO: why do we need this variable?
export DOTNET_VERSION=$(ls ${DOTNET_SDK_PATH}) && echo "DOTNET_VERSION = ${DOTNET_VERSION}" && \
# TODO: why do we need this variable? does it need to be an ENV var in the container? If so we will have to compute it in the entrypoint.sh instead
export MSBuildSDKsPath=/usr/lib64/dotnet/sdk/${DOTNET_VERSION}/Sdks && echo "MSBuildSDKsPath = ${MSBuildSDKsPath}"
ADD entrypoint.sh ${HOME}/entrypoint.sh
# built in Brew, use get-sources-jenkins.sh to pull latest
# TODO remove this line if we no longer need the lang server deps tarball below
COPY codeready-workspaces-stacks-language-servers-dependencies-dotnet.tar.gz /tmp/codeready-workspaces-stacks-language-servers-dependencies-dotnet.tar.gz
# TODO remove these if we no longer need the lang server deps tarball below
RUN tar xzf /tmp/codeready-workspaces-stacks-language-servers-dependencies-dotnet.tar.gz -C ${HOME}/che/ls-csharp && \
rm -f /tmp/codeready-workspaces-stacks-language-servers-dependencies-dotnet.tar.gz
USER jboss
ENTRYPOINT ["/home/jboss/entrypoint.sh"]
WORKDIR /projects
CMD tail -f /dev/null
# TODO remove these if we no longer need the lang server deps tarball above
# insert generated LABELs below this line
LABEL \
git.commit.redhat-developer__codeready-workspaces-deprecated="https://github.com/redhat-developer/codeready-workspaces-deprecated/commit/da621" \
pom.version.redhat-developer__codeready-workspaces-deprecated="2.0.0.GA-SNAPSHOT" \
jenkins.build.url="https://codeready-workspaces-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/CRW_CI/view/Pipelines/job/crw-operator-installer-and-ls-deps_master/139/" \
jenkins.artifact.url="https://codeready-workspaces-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/CRW_CI/view/Pipelines/job/crw-operator-installer-and-ls-deps_master/139/artifact/**/codeready-workspaces-stacks-language-servers-dependencies-dotnet.tar.gz" \
jenkins.build.number="139"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment