Skip to content

Lesson 2 - Timezone request - HTTP error #1

Open
@ccdaniele

Description

@ccdaniele

After building and push the image I have found two errors:

Updating the image with the suggestions below

  1. To avoid get stuck in the TZ question

ENV TZ=America/New_York
RUN /bin/sh -c ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 
  1. The http-server plugging is broken for nodejs version > 10Server Crashing with "Cannot set headers after they are sent to the client" http-party/http-server#634

The following command update the nodejs version

RUN curl https://nodejs.org/download/release/v13.0.1/node-v13.0.1-linux-arm64.tar.gz | bash -
ENV NODE_VERSION=16.13.0
RUN apt install -y curl
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version
RUN npm --version

Installing latest version of http-server

RUN npm install -g http-server latest

WORKDIR /usr/apps/hello-world/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions