Skip to content

Commit 1abac63

Browse files
authored
Fix bashrc behavior (#16)
* Fix bashrc to correctly call /etc/bashrc and correctly close prompt expressions Remove extraneous sed to bashrc Signed-off-by: Daniel Chaffelson <[email protected]>
1 parent c1a0676 commit 1abac63

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
1818
&& rm -rf /var/cache/dnf \
1919
&& pip install -r /runner/deps/python_base.txt \
2020
&& ansible-galaxy install -r /runner/deps/ansible.yml \
21-
&& mkdir -p /home/runner/.ansible/log
21+
&& mkdir -p /home/runner/.ansible/log \
22+
&& mv /runner/bashrc /home/runner/.bashrc
2223

2324
ENV CLDR_BUILD_DATE=${BUILD_DATE}
2425
ENV CLDR_BUILD_VER=${BASE_IMAGE_TAG}
@@ -35,8 +36,6 @@ LABEL maintainer="Cloudera Labs <[email protected]>" \
3536
org.label-schema.description="Ansible-Runner image with deps for CDP and underlying infrastructure" \
3637
org.label-schema.schema-version="1.0"
3738

38-
RUN sed -i "s/VERSION/${CLDR_BUILD_VER}/g" /runner/bashrc && mv /runner/bashrc /home/runner/.bashrc
39-
4039
## Set up the execution
4140
CMD ["ansible-runner", "run", "/runner"]
4241

payload/bashrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
PS1="\e[1;38;5;202mcldr ${CLDR_BUILD_VER} \$> \e[0m"
1+
# Source global definitions
2+
if [ -f /etc/bashrc ]; then
3+
. /etc/bashrc
4+
fi
5+
6+
PS1="\[\e[1;38;5;202m\]cldr ${CLDR_BUILD_VER} \[\e[0m\]\\$> "

0 commit comments

Comments
 (0)