How to save running docker image to file?

I have run Docker (Ubuntu-based) containing SQL Server 2022. Then I have added Full-Text search + accepted FTS license. For it I have created Docker_new file. It works fine. This is my Docker_new file

FROM mcr.microsoft.com/mssql/server:2022-latest
USER root
RUN apt-get update && apt-get install -yq curl apt-transport-https 
RUN apt-get update && \
    apt-get install -yq curl apt-transport-https && \
    curl https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2022.list | tee /etc/apt/sources.list.d/mssql-server.list && \
    apt-get update && \
    apt-get install -y mssql-server-fts

Now I need to provide this docker for my colleagues: I have made

docker save to *.tar file
copied it t other machine and run doсker load and then docker-compose.

But received an error:

the file Docker_new not found.

What is better way to provide this docker to other colleagues?

Hi,

What name does the image have in docker images? is it the same name as image: in the docker compose file? have you tried removing the β€œbuild” tag from your docker compose file so it dosnt look for the file if it isnt there?

Here is my docker-compose file
version: β€œ3.4”
services:
sql-server-db:
build:
context: .
dockerfile: Dockerfile.new
ports:
- β€œ52477:1433”

environment:
    SA_PASSWORD: "gomeandone"
    ACCEPT_EULA: "Y"
networks:
  - mssql
volumes:
  - /e/Mix/Data:/var/opt/mssql/data

networks:
mssql:
driver: bridge

Hi again,

the image that now has been imported on target machine via docker load, you need to find out which name it has ( docker image ls )
and in your docker compose file, you need to define this, and just remove the build tag (only on the target machines)

version: β€œ3.4”
services:
  sql-server-db:
    image: THE-IMAGE-NAME
    ports:
      - "52477:1433"
    environment:
      SA_PASSWORD: "gomeandone"
      ACCEPT_EULA: "Y"
    networks:
      - mssql
    volumes:
      - /e/Mix/Data:/var/opt/mssql/data

networks:
  mssql:
    driver: bridge
1 Like

Thank you, will try.