You can use a docker-compose file using the target option:
version: '3.4'
services:
img1:
build:
context: .
target: img1
img2:
build:
context: .
target: img2
using your Dockerfile
with the following content:
FROM alpine as img1
COPY file1.txt .
FROM alpine as img2
COPY file2.txt .