-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (46 loc) · 2.23 KB
/
Dockerfile
File metadata and controls
60 lines (46 loc) · 2.23 KB
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
55
56
57
58
59
60
# Use Execution Environment image based on Red Hat Universal Base Image 8
FROM quay.io/agnosticd/ee-multicloud:latest
# Software versions
ENV CODE_SERVER_VERSION="4.10.0"
ENV MAVEN_VERSION="3.8.7"
ENV OCP_VERSION="4.11"
ENV JAVA_VERSION="11"
# Directories
ENV CODE_SERVER_HOME=/home/codeserver
LABEL name="Code Server - Developer IDE" \
vendor="Code Server" \
io.k8s.display-name="Code Server - Developer IDE" \
io.openshift.expose-services="8080,codeserver" \
io.openshift.tags="codeserver" \
build-date="2023-02-18" \
version=$CODE_SERVER_VERSION \
release="1" \
maintainer="Wolfgang Kulhanek <wkulhanek@redhat.com>"
#Install chrome for Unit Tests
COPY *.repo /etc/yum.repos.d/
RUN dnf -y install xdg-utils liberation-fonts google-chrome && dnf clean all
RUN dnf -y install sudo git tar wget java-${JAVA_VERSION}-openjdk java-${JAVA_VERSION}-openjdk-devel && \
dnf -y install https://github.com/coder/code-server/releases/download/v${CODE_SERVER_VERSION}/code-server-${CODE_SERVER_VERSION}-amd64.rpm && \
rm -rf /var/cache/dnf /root/.cache
# Install Maven
RUN wget -O /tmp/maven.tar.gz https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz && \
mkdir -p /usr/local/maven && tar -C /usr/local/maven --strip-components=1 -xzvf /tmp/maven.tar.gz && \
ln -s /usr/local/maven/bin/mvn /usr/local/bin/mvn && \
rm /tmp/maven.tar.gz
# Install OC CLI
RUN wget -O /tmp/oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable-${OCP_VERSION}/openshift-client-linux.tar.gz && \
tar -C /usr/bin -zxvf /tmp/oc.tar.gz && \
rm /tmp/oc.tar.gz
COPY run-code-server.sh /usr/bin/run-code-server.sh
RUN adduser codeserver --home-dir=${CODE_SERVER_HOME} && \
chmod 770 ${CODE_SERVER_HOME} && \
chgrp 0 ${CODE_SERVER_HOME} && \
chmod -R g=u ${CODE_SERVER_HOME} /etc/passwd && \
chmod +x /usr/bin/run-code-server.sh
USER codeserver
WORKDIR ${CODE_SERVER_HOME}
VOLUME ${CODE_SERVER_HOME}
EXPOSE 8080
ENTRYPOINT ["/usr/bin/run-code-server.sh"]
# CMD ["code-server", "--config", "/home/codeserver/.config/code-server/config.yaml", "--user-data-dir", "/home/codeserver/repos/.local/share/code-server/User"]
CMD ["code-server"]