docker-compose with golang, nginx and postgres cannot find ./main

Advertisements I am trying to run a docker-compose setup with 3 containers: golang app (api), postgres and nginx. I created the docker-compose file and a Dockerfile for golang. I tried different approaches, but I still have an error "Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable… Read More docker-compose with golang, nginx and postgres cannot find ./main

Trying to Dockerize Maven Application but got "release version 21 not supported"

Advertisements New to Java and Docker, trying to dockerize this (my first Spring Boot application) with: Dockerfile FROM maven:3.8.4-jdk-11 AS build COPY src /app/src COPY pom.xml /app WORKDIR /app RUN mvn clean install -U FROM openjdk:8-jre-alpine COPY –from=build /app/target/mal-randomizer-0.0.1-SNAPSHOT.jar /app/app.jar WORKDIR /app EXPOSE 8080 CMD ["java", "-jar", "app.jar"] Got this error multiple times last night:… Read More Trying to Dockerize Maven Application but got "release version 21 not supported"

How to install /usr/bin/npm with Docker

Advertisements I have the following Dockerfile. It correctly installs /usr/bin/node but not /usr/bin/npm. What do I need to add/change to fix this? FROM php:8.3-apache COPY –from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get update && \ apt-get install -y gnupg && \ mkdir -p /etc/apt/keyrings && \ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg –dearmor -o /etc/apt/keyrings/nodesource.gpg && \ NODE_MAJOR=21… Read More How to install /usr/bin/npm with Docker

error in creating view in docker mssql database

Advertisements I got a problem with running sql script in docker image. I’m building a dockerfile, which looks like this: FROM mcr.microsoft.com/mssql/server:2019-latest USER root RUN mkdir -p /app/config WORKDIR /app/config # Copy all the scripts to create tables, views, etc… COPY sample_data/ /app/config EXPOSE 1433 ENV ACCEPT_EULA=Y \ MSSQL_SA_PASSWORD=SuperDup3Rsecre7 \ MSSQL_PID=Express RUN chmod +x /app/config/entrypoint.sh… Read More error in creating view in docker mssql database

Dockerfile is not copying from the context directory (as defined in docker-compose)

Advertisements I have a Dockerfile and a docker-compose that work when in the same directory. However I’m trying to make an orchestration docker-compose which will build multiple images from different repositories. My folder structure looks like this: my-apps/ my-apps/service-orchestration my-apps/service-orchestration/docker-compose.yaml my-apps/service-one # this is the root directory of the service-one app my-apps/service-one/Dockerfile my-apps/service-two … The… Read More Dockerfile is not copying from the context directory (as defined in docker-compose)

docker file, failed to solve: failed to compute cache key: failed to calculate checksum of ref

Advertisements I try to dockerize a react-native app with expo. And the dockerfile and docker-compose.yml file are in the root folder: dwl-frontend. So this is the dockerfile: # pull base image FROM node:14.13.1-buster-slim ARG NODE_ENV=production ENV NODE_ENV $NODE_ENV ARG PORT=19006 ENV PORT $PORT EXPOSE $PORT 19001 19002 ENV NPM_CONFIG_PREFIX=/home/node/.npm-global ENV PATH /home/node/.npm-global/bin:$PATH RUN npm i… Read More docker file, failed to solve: failed to compute cache key: failed to calculate checksum of ref

Docker printing out empty string instead of a value set during build

Advertisements This is my dockerfile: FROM python:3.11-slim-bullseye COPY requirements.txt . RUN python -m pip install –upgrade pip RUN python -m pip install -r requirements.txt ARG my_build_arg CMD echo $my_build_arg I want to set an argument at the time of building the image. So, I run this command: docker build –build-arg my_build_arg=’my_fantastic_value’ -t ‘my_image’ . When… Read More Docker printing out empty string instead of a value set during build

Cannot start container with docker compose up

Advertisements I am trying to Dockerize an application and it’s my first time. Have a Docker file inside the working directory: # syntax=docker/dockerfile:1 FROM ubuntu:22.04 ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 WORKDIR / RUN apt-get update && apt-get install -y python3.10 python3-pip RUN apt-get update && apt-get install -y git RUN apt-get update && apt-get… Read More Cannot start container with docker compose up

Dynamic image resolution in docker multi stage builds

Advertisements Is it possible to have a dynamic image resolution in docker for multistage builds? The following works ARG node_version=10-alpine FROM node:${node_version} as stage1 but the following FROM ubuntu as dbdump ARG node_version=10-alpine FROM node:${node_version} as stage1 fails with the error Dockerfile:5 ——————– 3 | ARG node_version=10-alpine 4 | 5 | >>> FROM node:${node_version} as… Read More Dynamic image resolution in docker multi stage builds