File tree 11 files changed +60
-45
lines changed 11 files changed +60
-45
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,8 @@ ENV PATH=$HOME/.cargo/bin:$PATH
11
11
RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal --no-modify-path --default-toolchain stable \
12
12
-c rls rust-analysis rust-src rustfmt clippy \
13
13
&& for cmp in rustup cargo; do rustup completions bash "$cmp" > "$HOME/.local/share/bash-completion/completions/$cmp" ; done \
14
- && printf '%s\n ' 'export CARGO_HOME=/workspace/.cargo' \
15
- 'mkdir -m 0755 -p "$CARGO_HOME/bin" 2>/dev/null' \
16
- 'export PATH=$CARGO_HOME/bin:$PATH' \
17
- 'test ! -e "$CARGO_HOME/bin/rustup" && mv "$(command -v rustup)" "$CARGO_HOME/bin"' > $HOME/.bashrc.d/80-rust \
18
14
&& cargo install cargo-watch cargo-edit cargo-workspaces \
19
15
&& rm -rf "$HOME/.cargo/registry" # This registry cache is now useless as we change the CARGO_HOME path to `/workspace`
16
+
17
+ COPY --chown=gitpod:gitpod rust_bashrc.sh $HOME/.bashrc.d/80-rust
18
+ COPY --chown=gitpod:gitpod rust_runonce.sh $HOME/.runonce/80-rust
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ if test -e " ${GITPOD_REPO_ROOT:- } " ; then {
4
+ export CARGO_HOME=/workspace/.cargo
5
+ export PATH=$CARGO_HOME /bin:$PATH
6
+ }; fi
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ if test -e " ${GITPOD_REPO_ROOT:- } " ; then {
4
+ CARGO_HOME=" /workspace/.cargo"
5
+ mkdir -p " $CARGO_HOME /bin" 2> /dev/null
6
+
7
+ if test ! -e " $CARGO_HOME /bin/rustup" && rustup=" $( command -v rustup) " ; then {
8
+ mv " ${rustup} " " $CARGO_HOME /bin"
9
+ }; fi
10
+ }; fi
Original file line number Diff line number Diff line change @@ -13,11 +13,4 @@ ENV PATH=/home/gitpod/dotnet:$PATH
13
13
14
14
# TODO(toru): Remove this hack when the kernel bug is resolved.
15
15
# ref. https://github.com/gitpod-io/gitpod/issues/8901
16
- RUN bash \
17
- && { echo 'if [ ! -z $GITPOD_REPO_ROOT ]; then' ; \
18
- echo '\t CONTAINER_DIR=$(awk ' \' '{ print $6 }' \' ' /proc/self/maps | grep ^\/ run\/ containerd | head -n 1 | cut -d ' \' '/' \' ' -f 1-6)' ; \
19
- echo '\t if [ ! -z $CONTAINER_DIR ]; then' ; \
20
- echo '\t\t [[ ! -d $CONTAINER_DIR ]] && sudo mkdir -p $CONTAINER_DIR && sudo ln -s / $CONTAINER_DIR/rootfs' ; \
21
- echo '\t fi' ; \
22
- echo 'fi' ; } >> /home/gitpod/.bashrc.d/110-dotnet
23
- RUN chmod +x /home/gitpod/.bashrc.d/110-dotnet
16
+ COPY --chown=gitpod:gitpod dotnet_runonce.sh $HOME/.runonce/110-dotnet
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ if [ -n " ${GITPOD_REPO_ROOT:- } " ]; then
4
+ CONTAINER_DIR=$( awk ' { print $6 }' /proc/self/maps | grep ' ^/run/containerd' | head -n 1 | cut -d ' /' -f 1-6)
5
+ if [ -n " ${CONTAINER_DIR} " ] && [ ! -d " ${CONTAINER_DIR} " ]; then
6
+ sudo sh << -CMD
7
+ mkdir -p "${CONTAINER_DIR} " && ln -s / "${CONTAINER_DIR} /rootfs"
8
+ CMD
9
+ fi
10
+ fi
Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ COPY mysql-bashrc-launch.sh /etc/mysql/mysql-bashrc-launch.sh
21
21
22
22
USER gitpod
23
23
24
- RUN echo "/etc/mysql/mysql-bashrc-launch.sh" >> /home/gitpod/.bashrc.d /100-mysql-launch
24
+ RUN echo "/etc/mysql/mysql-bashrc-launch.sh" >> $HOME/.runonce /100-mysql-launch
Original file line number Diff line number Diff line change @@ -25,6 +25,6 @@ ENV PATH="$HOME/.pg_ctl/bin:$PATH"
25
25
ENV DATABASE_URL="postgresql://gitpod@localhost"
26
26
ENV PGHOSTADDR="127.0.0.1"
27
27
ENV PGDATABASE="postgres"
28
- COPY --chown=gitpod:gitpod postgresql-hook.bash $HOME/.bashrc.d /200-postgresql-launch
28
+ COPY --chown=gitpod:gitpod postgresql-hook.bash $HOME/.runonce /200-postgresql-launch
29
29
30
30
USER gitpod
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
# Auto-start PostgreSQL server
3
- (
4
- if mkdir /tmp/.pgsql_lock 2> /dev/null; then {
5
- target=" ${PGWORKSPACE} "
6
- source=" ${target// \/ workspace/ $HOME } "
3
+ target=" ${PGWORKSPACE} "
4
+ source=" ${target// \/ workspace/ $HOME } "
7
5
8
- if test -e " $source " ; then {
6
+ if test -e " $source " ; then {
9
7
10
- if test ! -e " $target " ; then {
11
- mv " $source " " $target "
12
- }; fi
8
+ if test ! -e " $target " ; then {
9
+ mv " $source " " $target "
10
+ }; fi
13
11
14
- if ! [[ " $( pg_ctl status) " =~ PID ]]; then {
15
- printf ' INFO: %s\n' " Executing command: pg_start"
16
- pg_start
17
- trap " pg_stop" TERM EXIT
18
- exec {sfd}<> <( :)
19
- printf ' INFO: %s\n' \
20
- " Please create another terminal" \
21
- " this one is monitoring postgres server for gracefully shutting down when needed"
22
- until read -r -t 3600 -u $sfd ; do continue ; done
23
- }; fi
12
+ if ! [[ " $( pg_ctl status) " =~ PID ]]; then {
13
+ printf ' INFO: %s\n' " Executing command: pg_start"
14
+ pg_start
15
+ (
16
+ trap " pg_stop" TERM EXIT
17
+ exec {sfd}<> <( :)
18
+ # printf 'INFO: %s\n' \
19
+ # "Please create another terminal" \
20
+ # "this one is monitoring postgres server for gracefully shutting down when needed"
21
+ until read -r -t 3600 -u $sfd ; do continue ; done
22
+ ) &
23
+ disown
24
+ }; fi
24
25
25
- }; fi
26
- }; fi &
27
- )
26
+ }; fi
Original file line number Diff line number Diff line change @@ -21,9 +21,8 @@ COPY novnc-index.html /opt/novnc/index.html
21
21
22
22
# Add VNC startup script
23
23
COPY gp-vncsession /usr/bin/
24
- RUN chmod 0755 "$(which gp-vncsession)" \
25
- && printf '%s\n ' 'export DISPLAY=:0' \
26
- 'test -e "$GITPOD_REPO_ROOT" && gp-vncsession' >> "$HOME/.bashrc"
24
+ RUN printf 'export DISPLAY=:%s\n ' '0' > "$HOME/.bashrc.d/1000-vnc" \
25
+ && printf '%s\n ' 'gp-vncsession' > "$HOME/.runonce/1000-vnc"
27
26
# Add X11 dotfiles
28
27
COPY --chown=gitpod:gitpod .xinitrc $HOME/
29
28
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function log::info() {
13
13
printf ' info[%s]: %s\n' " ${0##*/ } " " $@ "
14
14
}
15
15
16
- if test ! -e /tmp/.X0-lock ; then {
16
+ if test ! -d /tmp/.X11-unix ; then {
17
17
: " ${DISPLAY:= " :0" } "
18
18
export DISPLAY
19
19
VNC_PORT=5900
@@ -47,12 +47,12 @@ if test ! -e /tmp/.X0-lock; then {
47
47
# # Create .xinit
48
48
# log::info 'Creating .xinit script'
49
49
# printf '%s\n' '#!/bin/sh' 'exec dbus-launch --exit-with-session xfce4-session;' > $HOME/.xinitrc;
50
- chmod 755 " $HOME /.xinitrc"
50
+ # chmod 755 "$HOME/.xinitrc"
51
51
52
52
# Start vncserver
53
53
log::info " Starting tigerVNC server on port $VNC_PORT "
54
54
# vncserver -kill "${DISPLAY}"
55
- start_service " $( command -v vncserver) " -geometry " ${TIGERVNC_GEOMETRY:- 1920x1080} " -SecurityTypes None $ DISPLAY
55
+ start_service " $( command -v vncserver) " -geometry " ${TIGERVNC_GEOMETRY:- 1920x1080} " -SecurityTypes None " ${ DISPLAY} "
56
56
57
57
# Wait
58
58
log::info " Waiting for the desktop to be fully loaded ..."
Original file line number Diff line number Diff line change @@ -49,9 +49,8 @@ ENV YSQL_API_PORT=13000
49
49
ENV YCQL_API_PORT=12000
50
50
51
51
# re-initialization is automatically handled
52
- RUN echo "\n # yugabytedb start command" >> /home/gitpod/.bashrc.d/100-yugabyedb-launch
53
- RUN echo "[[ -f \$ {GITPOD_REPO_ROOT}/.nopreload ]] || yugabyted start --base_dir=$STORE --listen=$HOST > /dev/null" >> /home/gitpod/.bashrc.d/100-yugabyedb-launch
54
-
55
- RUN chmod +x /home/gitpod/.bashrc.d/100-yugabyedb-launch
52
+ RUN printf '%s\n ' \
53
+ "\n # yugabytedb start command" \
54
+ "[[ -f \$ {GITPOD_REPO_ROOT}/.nopreload ]] || yugabyted start --base_dir=$STORE --listen=$HOST > /dev/null" > $HOME/.runonce/100-yugabyedb-launch
56
55
57
56
EXPOSE ${YSQL_PORT} ${YCQL_PORT} ${WEB_PORT} ${TSERVER_WEB_PORT} ${YSQL_API_PORT} ${YCQL_API_PORT}
You can’t perform that action at this time.
0 commit comments