Run Docker Image as Operating System

Viewed 34

I have a docker image built from alpine that I want to reuse throught my Gitlab pipeline with some scripts. That is, I want a ready made image with exactly what I want to do rather than just using some alpine image directly and adding redundant files to my repo. How do I run the docker image built as an OS and not just to run some program on start?

The goal is to have this image within Gitlab job pipeline and freely access the files/scripts whenever I need, and run them on the pipeline.

FROM python:3-alpine

WORKDIR /usr/src/app 

COPY . /usr/src/app

# Default args, these are variables that can be passed in during build.
ARG APP_BUILD="NONE"
ARG APP_VERSION="NONE"

# RUN pip install awscli --upgrade
# RUN pip install boto3
RUN pip install requests
RUN pip install python-dotenv

# CMD [ "python3", "./release.py" ]

So I got the chance to see if the files exist and they are there after running

find /usr/src/app
...
...
...
/usr/src/app/release.py
/usr/src/app/script.sh
/usr/src/app/.gitlab-ci.yml
/usr/src/app/README.md
/usr/src/app/Dockerfile

However, when running my script file it is say /bin/sh: eval: line 136: /usr/src/app/script.sh: not found

0 Answers
Related