0

I've tried to build a docker image following the documentation on Docker Hub. Below is the docker image contents:

FROM alpine:latest
              # This sets the image we start building from
RUN apk add --update \          # first update
   python3 \                    # Install Python
   py-pip \                    # Install pip
 && pip install flywheel-sdk \ # Use pip to install the flywheel SDK
 && rm -rf /var/cache/apk/*    # Cleanup install files

ENV FLYWHEEL=/flywheel/v0
 # Setup default flywheel/v0 directory

RUN mkdir -p ${FLYWHEEL}        # Create that directory
COPY run.py ${FLYWHEEL}/run.py  # Copy in our runscript into the docker image

ENTRYPOINT ["python run.py"]    # Set an entrypoint

when I do docker build I get an error that looks like Python is unable to load from the alpine:python image.

(base) isabelannwingert@Isabels-MacBook-Pro PET_gear % docker build -t isabelannwingert36/alpine-python-3:0.1.0 ./
Sending build context to Docker daemon  6.144kB
Error response from daemon: Dockerfile parse error line 4: unknown instruction: PYTHON3

When I re-do docker pull alpine:latest it tells me that everything is up-to-date, yet I also do not see it in my repository on Docker Hub.

Is there anything else I can try? (I'm new to Docker Hub so excuse my naivete).

1 Answer 1

1

Docker doesn't support same line comments. Hence the issue. Please rewrite your code like this.

# This sets the image we start building from
FROM alpine:latest
# First update, Install Python, Install pip
# Use pip to install the flywheel SDK, Cleanup install files
RUN apk add --update python3 py-pip \
  && pip install flywheel-sdk \
  && rm -rf /var/cache/apk/*

# Setup default flywheel/v0 directory
ENV FLYWHEEL=/flywheel/v0

# Create that directory
RUN mkdir -p ${FLYWHEEL}
# Copy in our runscript into the docker image
COPY run.py ${FLYWHEEL}/run.py

# Set an entrypoint
ENTRYPOINT ["python run.py"]
Sign up to request clarification or add additional context in comments.

1 Comment

Please accept if this solves your problem so that others won't have to check this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.